Skip to content

Instantly share code, notes, and snippets.

@huseyinyilmaz
Created November 17, 2016 01:07
Show Gist options
  • Save huseyinyilmaz/a7e2e2307407a36842a6cf64875601ac to your computer and use it in GitHub Desktop.
Save huseyinyilmaz/a7e2e2307407a36842a6cf64875601ac to your computer and use it in GitHub Desktop.
Setting path on a shell script:
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Turtle
import System.Process(callProcess)
import qualified Data.Text as Text
-- adds virtualenv wrapper to path
addVirtualenvWrapper = do
(exitSuccess, virtualenvwrapper) <- procStrict "which" ["virtualenvwrapper.sh"] empty
shells virtualenvwrapper empty
shells ("workon test") empty
-- gives following error:
--
-- /bin/sh: workon: command not found
-- venvtest.hs: ShellFailed {shellCommandLine = "workon test", shellExitCode = ExitFailure 127}
main = do
addVirtualenvWrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment