mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: Add support for active scanning in paranoid mode (#31)
* feat: Add support for active scanning in paranoid mode * docs: Fix README
This commit is contained in:
@@ -34,6 +34,7 @@ type PackageManagerGuardConfig struct {
|
||||
ResolveDependencies bool
|
||||
MaxConcurrentAnalyzes int
|
||||
AnalysisTimeout time.Duration
|
||||
DryRun bool
|
||||
}
|
||||
|
||||
func DefaultPackageManagerGuardConfig() PackageManagerGuardConfig {
|
||||
@@ -41,6 +42,7 @@ func DefaultPackageManagerGuardConfig() PackageManagerGuardConfig {
|
||||
ResolveDependencies: true,
|
||||
MaxConcurrentAnalyzes: 10,
|
||||
AnalysisTimeout: 5 * time.Minute,
|
||||
DryRun: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +162,11 @@ func (g *packageManagerGuard) continueExecution(ctx context.Context, pc *package
|
||||
return fmt.Errorf("no command to execute")
|
||||
}
|
||||
|
||||
if g.config.DryRun {
|
||||
log.Debugf("Dry run, skipping command execution")
|
||||
return nil
|
||||
}
|
||||
|
||||
cmd := exec.CommandContext(ctx, pc.Command.Exe, pc.Command.Args...)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
|
||||
Reference in New Issue
Block a user