import System.Process
createProcess (shell "pwd") -- /Users/username/current-directory
createProcess (shell "cd app") -- LOST
createProcess (shell "pwd") -- /Users/username/current-directory
Obviously, createProcess (shell "cd app") is not persistent in the next process.
But, how can I keep the session persistent?
I know I can pass cwd but
createProcess (shell "mkdir some-dir && cd some-dir")
createProcess (shell "pwd") { cwd = Just "some-dir" }
But, I have to parse the previous command to get "some-dir."
Is there something better than parsing the command?