fix flag inconsistency

This commit is contained in:
Sahilb315
2025-12-18 14:01:14 +05:30
parent adec9b67ca
commit b45c04444c
4 changed files with 12 additions and 18 deletions
+5 -3
View File
@@ -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)