Skip to content

Commit

Permalink
Show correct backup path in help output
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed May 14, 2024
1 parent 8d88cbe commit a8e50a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tasklite-core/source/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,9 @@ commandParser conf =
"Show SQL commands to create and populate database")

<> command "backup" (toParserInfo (pure Backup)
"Create a backup of the tasks database at ~/tasklite/backups")
("Create a backup of the tasks database at "
<> T.pack conf.dataDir <> "/backups"))

)

<|> hsubparser
Expand Down Expand Up @@ -1111,9 +1113,7 @@ handleExternalCommand conf cmd argsMb = do
then pretty (show exception :: Text)
else do
let
theHelp =
parserHelp defaultPrefs $
(helper <*> commandParser conf)
theHelp = parserHelp defaultPrefs (helper <*> commandParser conf)
newHeader =
Chunk
( Just $
Expand Down
8 changes: 4 additions & 4 deletions tasklite-core/source/ImportExport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ dumpSql conf = do
result <-
readProcess
"sqlite3"
[ dataDir conf </> dbName conf
[ conf.dataDir </> conf.dbName
, ".dump"
]
[]
Expand All @@ -726,7 +726,7 @@ backupDatabase conf = do
let
fileUtcFormat = toFormat ("YYYY-MM-DDtHMI" :: [Char])
backupDirName = "backups"
backupDirPath = dataDir conf </> backupDirName
backupDirPath = conf.dataDir </> backupDirName
backupFilePath = backupDirPath </> timePrint fileUtcFormat now <> ".db"

-- Create directory (and parents because of True)
Expand All @@ -736,7 +736,7 @@ backupDatabase conf = do
pretty
<$> readProcess
"sqlite3"
[ dataDir conf </> dbName conf
[ conf.dataDir </> conf.dbName
, ".backup '" <> backupFilePath <> "'"
]
[]
Expand All @@ -746,7 +746,7 @@ backupDatabase conf = do
<> hardline
<> pretty
( "✅ Backed up database \""
<> dbName conf
<> conf.dbName
<> "\" to \""
<> backupFilePath
<> "\""
Expand Down

0 comments on commit a8e50a2

Please sign in to comment.