summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-14 15:19:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-14 15:19:34 -0400
commita4fe8365f3745033a307817e754f132357af47f7 (patch)
treeb42a44eb4bc2a1b31752c5e654e72a2f09f4dc3f
parent19a173cfadf0cdccbe371772d341a75642dc6273 (diff)
nub the autostart file
It's possible for the file to get duplicate lines in it, and if so, we want to ignore the dups.
-rw-r--r--Command/Assistant.hs2
-rw-r--r--Command/WebApp.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Command/Assistant.hs b/Command/Assistant.hs
index 53f7e4baf..b039e2731 100644
--- a/Command/Assistant.hs
+++ b/Command/Assistant.hs
@@ -54,7 +54,7 @@ autoStart = do
let nothing = error $ "Nothing listed in " ++ autostartfile
ifM (doesFileExist autostartfile)
( do
- dirs <- lines <$> readFile autostartfile
+ dirs <- nub . lines <$> readFile autostartfile
program <- readProgramFile
when (null dirs) nothing
forM_ dirs $ \d -> do
diff --git a/Command/WebApp.hs b/Command/WebApp.hs
index 205e36341..f87ea983a 100644
--- a/Command/WebApp.hs
+++ b/Command/WebApp.hs
@@ -75,7 +75,7 @@ startNoRepo = do
autoStart :: FilePath -> IO ()
autoStart autostartfile = do
- dirs <- lines <$> readFile autostartfile
+ dirs <- nub . lines <$> readFile autostartfile
edirs <- filterM doesDirectoryExist dirs
case edirs of
[] -> firstRun -- what else can I do? Nothing works..