mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
small fixes
This commit is contained in:
+3
-3
@@ -70,13 +70,13 @@ func NewRemoveCommand() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
config := alias.DefaultConfig()
|
||||
rcFileManager, err := alias.NewDefaultRcFileManager(config.RcFileName)
|
||||
cfg := alias.DefaultConfig()
|
||||
rcFileManager, err := alias.NewDefaultRcFileManager(cfg.RcFileName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
aliasManager := alias.New(config, rcFileManager)
|
||||
aliasManager := alias.New(cfg, rcFileManager)
|
||||
return aliasManager.Remove()
|
||||
},
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ type Config struct {
|
||||
// InsecureInstallation allows bypassing install blocking on malicious packages
|
||||
InsecureInstallation bool `mapstructure:"insecure_installation"`
|
||||
|
||||
// TrustedPackages allows for trusting an suspicious package and ignoring the suspicious behaviour for the package in future installations
|
||||
// TrustedPackages allows for trusting a suspicious package and ignoring the suspicious behaviour for the package in future installations
|
||||
TrustedPackages TrustedPackage `mapstructure:"trusted_packages"`
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ transitive_depth: 7
|
||||
include_dev_dependencies: true
|
||||
dry_run: true
|
||||
paranoid: true
|
||||
trusted_packages: ["a","b"]
|
||||
trusted_packages: {'purls': ["a", "b"]}
|
||||
`), 0o644))
|
||||
|
||||
fs := pflag.NewFlagSet("test", pflag.ContinueOnError)
|
||||
@@ -87,5 +87,5 @@ trusted_packages: ["a","b"]
|
||||
assert.True(t, cfg.IncludeDevDependencies, "include_dev_dependencies should be overridden by file to true")
|
||||
assert.True(t, cfg.DryRun, "dry_run should be overridden by file to true")
|
||||
assert.True(t, cfg.Paranoid, "paranoid should be overridden by file to true")
|
||||
assert.ElementsMatch(t, []string{"a", "b"}, cfg.TrustedPackages, "trusted_packages should match file values")
|
||||
assert.ElementsMatch(t, []string{"a", "b"}, cfg.TrustedPackages.Purl, "trusted_packages should match file values")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user