-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(be): use omitempty for json config
- Loading branch information
Showing
5 changed files
with
139 additions
and
90 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,37 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/ansible-semaphore/semaphore/cli/setup" | ||
"github.com/ansible-semaphore/semaphore/util" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
runnerCmd.AddCommand(runnerSetupCmd) | ||
} | ||
|
||
var runnerSetupCmd = &cobra.Command{ | ||
Use: "setup", | ||
Short: "Perform interactive setup", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
doRunnerSetup() | ||
}, | ||
} | ||
|
||
// nolint: gocyclo | ||
func doRunnerSetup() int { | ||
var config *util.ConfigType | ||
config = &util.ConfigType{} | ||
|
||
setup.InteractiveRunnerSetup(config) | ||
|
||
configPath := setup.SaveConfig(config) | ||
|
||
util.ConfigInit(configPath, false) | ||
|
||
fmt.Printf(" Re-launch this program pointing to the configuration file\n\n./semaphore server --config %v\n\n", configPath) | ||
fmt.Printf(" To run as daemon:\n\nnohup ./semaphore server --config %v &\n\n", configPath) | ||
|
||
return 0 | ||
} |
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