Skip to content

Commit

Permalink
Bump version and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu committed Sep 18, 2020
1 parent aa57702 commit 96b0a5a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ a dump file from production
Write sql statements in a file (default '.cappa.sql') separate by newline and run this command.`,
Run: func(cmd *cobra.Command, args []string) {
log.Println("Command `execute` called")
sqlFileName := "..cappa.sql"
sqlFileName := ".cappa.sql"

// open sql file
dat, err := ioutil.ReadFile(sqlFileName)
Expand Down
13 changes: 10 additions & 3 deletions cmd/revert.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import (
"context"
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/AlecAivazis/survey/v2/terminal"
"log"
"os"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -51,11 +53,16 @@ to quickly create a Cobra application.`,

var snapshotSelected string
prompt := &survey.Select{
Message: "Select snapshot to remove :",
Message: "Select snapshot to revert to primary database :",
Options: options,
}
survey.AskOne(prompt, &snapshotSelected, survey.WithPageSize(50))
fmt.Printf("Selected is : %v", snapshotSelected)
err = survey.AskOne(prompt, &snapshotSelected, survey.WithValidator(survey.Required))
if err == terminal.InterruptErr {
fmt.Println("User terminated prompt")
os.Exit(0)
} else if err != nil {
log.Fatal(err)
}

for _, snap := range list {
if snap.Name == snapshotSelected {
Expand Down
6 changes: 4 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ type Config struct {
var rootCmd = &cobra.Command{
Use: `cappa`,
Short: `It is like Git, but for development databases`,
Long: `
Cappa allows you to make fast snapshot of your working database and revert back to one of them.
Long: `It is like Git, but for development databases
Cappa allows you to take fast snapshots of your development database.
You can revert back to one of them.
Useful when you have git branches containing migrations
- Heavily inspired by fastmonkeys/stellar
`,
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var versionCmd = &cobra.Command{
Short: "Print the version number of Cappa",
Long: `All software has versions. This is Cappa's`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Cappa v0.6 - Alpha")
fmt.Println("Cappa v0.6 - Beta")
},
}

Expand Down

0 comments on commit 96b0a5a

Please sign in to comment.