mirror of
https://github.com/aljazceru/nigiri.git
synced 2026-02-09 08:44:33 +01:00
* remove init command * add use of docker volumes * pull images from docker hub * create start stop delete commands * add resources folder
27 lines
550 B
Go
27 lines
550 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
"github.com/spf13/cobra"
|
|
"github.com/vulpemventures/nigiri/cli/config"
|
|
)
|
|
|
|
var VersionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Get current tool version",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
viper := config.Viper()
|
|
fmt.Println(viper.GetString("version"))
|
|
os.Exit(0)
|
|
},
|
|
PreRun: func(cmd *cobra.Command, args []string) {
|
|
datadir, _ := cmd.Flags().GetString("datadir")
|
|
if err := config.ReadFromFile(datadir); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
},
|
|
}
|