Commit dcac3bb8 authored by Andrew Gibiansky's avatar Andrew Gibiansky

better 'cd non-existent-dir' err msg, closes #97

parent 92361c93
......@@ -410,8 +410,13 @@ evalCommand publish (Directive ShellCmd ('!':cmd)) state = wrapExecution state $
case words cmd of
"cd":dirs ->
let directory = unwords dirs in do
setCurrentDirectory directory
return []
exists <- doesDirectoryExist directory
if exists
then do
setCurrentDirectory directory
return []
else
return $ displayError $ printf "No such directory: '%s'" directory
cmd -> do
(readEnd, writeEnd) <- createPipe
handle <- fdToHandle writeEnd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment