mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
fix: UI handling bugs
This commit is contained in:
+2
-1
@@ -3,6 +3,7 @@ package npm
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
|
||||||
|
"github.com/safedep/dry/log"
|
||||||
"github.com/safedep/pmg/config"
|
"github.com/safedep/pmg/config"
|
||||||
"github.com/safedep/pmg/internal/ui"
|
"github.com/safedep/pmg/internal/ui"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@@ -21,7 +22,7 @@ func NewNpmCommand() *cobra.Command {
|
|||||||
|
|
||||||
err = executeNpmFlow(cmd.Context(), config, args)
|
err = executeNpmFlow(cmd.Context(), config, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ui.Fatalf("Failed to execute npm flow: %s", err)
|
log.Errorf("Failed to execute npm flow: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
+2
-1
@@ -3,6 +3,7 @@ package npm
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
|
||||||
|
"github.com/safedep/dry/log"
|
||||||
"github.com/safedep/pmg/config"
|
"github.com/safedep/pmg/config"
|
||||||
"github.com/safedep/pmg/internal/ui"
|
"github.com/safedep/pmg/internal/ui"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@@ -21,7 +22,7 @@ func NewPnpmCommand() *cobra.Command {
|
|||||||
|
|
||||||
err = executePnpmFlow(cmd.Context(), config, args)
|
err = executePnpmFlow(cmd.Context(), config, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ui.Fatalf("Failed to execute pnpm flow: %s", err)
|
log.Errorf("Failed to execute pnpm flow: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -42,11 +42,7 @@ func (npm *npmPackageManager) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (npm *npmPackageManager) ParseCommand(args []string) (*ParsedCommand, error) {
|
func (npm *npmPackageManager) ParseCommand(args []string) (*ParsedCommand, error) {
|
||||||
if len(args) == 0 {
|
if len(args) > 0 && (args[0] == "npm" || args[0] == "pnpm") {
|
||||||
return nil, fmt.Errorf("no command specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
if args[0] == "npm" || args[0] == "pnpm" {
|
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user