hpasteit 0.2.2.0 → 0.2.3.0
raw patch · 2 files changed
+11/−6 lines, 2 filesdep ~bytestring
Dependency ranges changed: bytestring
Files
- HPasteIt.hs +9/−4
- hpasteit.cabal +2/−2
HPasteIt.hs view
@@ -3,7 +3,6 @@ import ProgOpts (ProgOpts(..), parseOpts) -import Data.Maybe import System.Directory import System.Environment import System.Exit@@ -15,7 +14,6 @@ import Control.Exception.Lifted import Network.HTTP.Conduit import Network.HTTP.Types-import Options.Applicative import System.Cmd main :: IO ()@@ -98,8 +96,15 @@ LBS.hPutStrLn hdl (responseBody resp) hFlush hdl - editor <- fromMaybe "vi" <$> lookupEnv "EDITOR"- exit_code <- rawSystem editor [file]+ editor <- do+ m_editor <- try (getEnv "EDITOR")+ case m_editor :: Either SomeException String of+ Right editor | not (null editor) -> return editor+ _otherwise -> do+ hPutStrLn stderr "$EDITOR not defined. Using 'vi'"+ return "vi"++ exit_code <- system (editor ++ " " ++ file) exitWith exit_code
hpasteit.cabal view
@@ -1,5 +1,5 @@ name: hpasteit-version: 0.2.2.0+version: 0.2.3.0 synopsis: A command-line client for hpaste.org license: BSD3 license-file: LICENSE@@ -28,7 +28,7 @@ other-modules: ProgOpts build-depends: base <5.0- , bytestring ==0.10.*+ , bytestring <0.11 , lifted-base ==0.2.* , http-conduit ==1.8.* , http-types ==0.7.*