feat(cmd/root): r flag default is now current working dir

This commit is contained in:
fwiedmann
2019-07-09 01:43:52 +02:00
parent 9ecd47654d
commit 8f876fa866

View File

@@ -32,7 +32,11 @@ func Execute(version string) {
} }
func init() { func init() {
rootCmd.PersistentFlags().StringP("repository", "r", "", "Path to repository") currentDir, err := os.Getwd()
if err != nil {
panic(err)
}
rootCmd.PersistentFlags().StringP("repository", "r", currentDir, "Path to repository")
rootCmd.PersistentFlags().StringP("loglevel", "l", "error", "Set loglevel") rootCmd.PersistentFlags().StringP("loglevel", "l", "error", "Set loglevel")
rootCmd.PersistentFlags().StringP("config", "c", ".release.yml", "Path to config file") rootCmd.PersistentFlags().StringP("config", "c", ".release.yml", "Path to config file")
rootCmd.PersistentFlags().Bool("no-cache", false, "Ignore cache, don't use in ci build") rootCmd.PersistentFlags().Bool("no-cache", false, "Ignore cache, don't use in ci build")