Skip to content

Commit

Permalink
refactor: add runtime exceptions for chosen commands
Browse files Browse the repository at this point in the history
Some commands should run even when there is no config folder in
existence on the system. These commands are 'proji', 'proji help',
'proji init' and 'proji version'.
  • Loading branch information
nikoksr committed Feb 24, 2020
1 parent a3174b2 commit 947a146
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/proji/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func init() {
viper.SetConfigName("config")
viper.AutomaticEnv()

if os.Args[1] != "init" {
if len(os.Args) > 1 && os.Args[1] != "init" && os.Args[1] != "version" && os.Args[1] != "help" {
cobra.OnInitialize(initConfig, initStorageService)
}
}
Expand Down

0 comments on commit 947a146

Please sign in to comment.