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.
This commit is contained in:
parent
04a69b22b1
commit
51ef707a59
3 changed files with 3 additions and 3 deletions
|
@ -153,6 +153,6 @@ otherReposWidget = do
|
||||||
listOtherRepos :: IO [(String, String)]
|
listOtherRepos :: IO [(String, String)]
|
||||||
listOtherRepos = do
|
listOtherRepos = do
|
||||||
f <- autoStartFile
|
f <- autoStartFile
|
||||||
dirs <- ifM (doesFileExist f) ( lines <$> readFile f, return [])
|
dirs <- nub <$> ifM (doesFileExist f) ( lines <$> readFile f, return [])
|
||||||
names <- mapM relHome dirs
|
names <- mapM relHome dirs
|
||||||
return $ sort $ zip names dirs
|
return $ sort $ zip names dirs
|
||||||
|
|
|
@ -54,7 +54,7 @@ autoStart = do
|
||||||
let nothing = error $ "Nothing listed in " ++ autostartfile
|
let nothing = error $ "Nothing listed in " ++ autostartfile
|
||||||
ifM (doesFileExist autostartfile)
|
ifM (doesFileExist autostartfile)
|
||||||
( do
|
( do
|
||||||
dirs <- lines <$> readFile autostartfile
|
dirs <- nub . lines <$> readFile autostartfile
|
||||||
program <- readProgramFile
|
program <- readProgramFile
|
||||||
when (null dirs) nothing
|
when (null dirs) nothing
|
||||||
forM_ dirs $ \d -> do
|
forM_ dirs $ \d -> do
|
||||||
|
|
|
@ -75,7 +75,7 @@ startNoRepo = do
|
||||||
|
|
||||||
autoStart :: FilePath -> IO ()
|
autoStart :: FilePath -> IO ()
|
||||||
autoStart autostartfile = do
|
autoStart autostartfile = do
|
||||||
dirs <- lines <$> readFile autostartfile
|
dirs <- nub . lines <$> readFile autostartfile
|
||||||
edirs <- filterM doesDirectoryExist dirs
|
edirs <- filterM doesDirectoryExist dirs
|
||||||
case edirs of
|
case edirs of
|
||||||
[] -> firstRun -- what else can I do? Nothing works..
|
[] -> firstRun -- what else can I do? Nothing works..
|
||||||
|
|
Loading…
Reference in a new issue