mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
fix flag inconsistency
This commit is contained in:
+5
-3
@@ -31,16 +31,18 @@ func NewInstallCommand() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "install",
|
||||
Short: "Setup PMG config and aliases for package managers (npm, pnpm, pip, and more)",
|
||||
Long: "",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Print(ui.GeneratePMGBanner(version.Version, version.Commit))
|
||||
|
||||
cfgPath, err := config.CreateConfig()
|
||||
if err != nil {
|
||||
if errors.Is(err, config.ErrConfigAlreadyExists) {
|
||||
fmt.Printf("PMG config already exists at %s\n", cfgPath)
|
||||
msg := fmt.Sprintf("⚠️ PMG config already exists at %s\n", cfgPath)
|
||||
ui.ShowWarning(msg)
|
||||
} else {
|
||||
return fmt.Errorf("failed to create config file: %w", err)
|
||||
er := fmt.Errorf("failed to create config file: %w", err)
|
||||
ui.ErrorExit(er)
|
||||
return er
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("📄 PMG config created at %s\n", cfgPath)
|
||||
|
||||
Reference in New Issue
Block a user