File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ import Data.Text (Text)
140
140
import qualified Data.Text as T
141
141
import qualified Data.Text.IO as T
142
142
import Data.Time (Day )
143
- import Safe (headDef )
143
+ import Safe (headDef , headMay )
144
144
import System.Directory (doesFileExist , getHomeDirectory )
145
145
import System.Environment (getEnv )
146
146
import System.Exit (exitFailure )
@@ -184,8 +184,12 @@ defaultJournal = defaultJournalPath >>= runExceptT . readJournalFile definputopt
184
184
-- determine a home directory).
185
185
defaultJournalPath :: IO String
186
186
defaultJournalPath = do
187
- s <- envJournalPath
188
- if null s then defpath else return s
187
+ p <- envJournalPath
188
+ if null p
189
+ then defpath
190
+ else do
191
+ ps <- expandGlob " ." p `C.catch` (\ (_:: C. IOException ) -> return [] )
192
+ maybe defpath return $ headMay ps
189
193
where
190
194
envJournalPath =
191
195
getEnv journalEnvVar
You can’t perform that action at this time.
0 commit comments