-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Added version/build information to header and about page
- Loading branch information
Luke Carr
committed
Apr 4, 2022
1 parent
8522ffb
commit 85f2d45
Showing
16 changed files
with
796 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/lukecarr/tiny-todo/internal/db" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func MakeMigrateCmd() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "migrate", | ||
Short: "Performs tiny-todo's SQLite database migrations", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
n, err := db.Migrate(args[0]) | ||
|
||
if err != nil { | ||
cmd.PrintErrf("%s\n", err) | ||
} else if n == 0 { | ||
cmd.Println("The provided SQLite database is already up to date!") | ||
} else { | ||
cmd.Printf("Applied %d migrations successfully!\n", n) | ||
} | ||
}, | ||
} | ||
} | ||
|
||
var migrateCmd = MakeMigrateCmd() | ||
|
||
func init() { | ||
rootCmd.AddCommand(migrateCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.