Commit 8031ee40 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Allow missing .last-arguments, assume $HOME for init dir or .

parent d9af2643
......@@ -275,7 +275,12 @@ writeInitInfo info = do
readInitInfo :: IO InitInfo
readInitInfo = shelly $ do
filename <- (</> ".last-arguments") <$> ihaskellDir
read <$> liftIO (readFile filename)
exists <- test_f filename
if exists
then read <$> liftIO (readFile filename)
else do
dir <- fromMaybe "." <$> fmap unpack <$> get_env "HOME"
return InitInfo { extensions = [], initCells = [], initDir = dir, frontend = IPythonNotebook }
-- | Create the IPython profile.
setupIPythonProfile :: WhichIPython
......
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