Skip to content

Commit

Permalink
fix: default scan arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasdaloia committed Jan 3, 2025
1 parent b0aaf53 commit 3529111
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions backend/service/scan_service_python_cli_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"os"
"os/exec"

"github.com/rs/zerolog/log"
"github.com/scanoss/scanoss.cc/internal/config"
"github.com/wailsapp/wails/v2/pkg/runtime"
)
Expand Down Expand Up @@ -97,21 +96,15 @@ func (s *ScanServicePythonImpl) executeScanWithPipes(args []string) (*exec.Cmd,

defaultArgs, sensitiveArgs := s.GetDefaultScanArgs(), s.GetSensitiveDefaultScanArgs()

log.Debug().Msgf("Scan with args: %v, total args: %v", args, len(args))

if len(args) == 0 {
log.Debug().Msg("No scan arguments provided, scanning current directory")
cmdArgs = append(cmdArgs, ".") // scan current directory by default
cmdArgs = append(cmdArgs, defaultArgs...)
} else {
log.Debug().Msg("No scan arguments provided, scanning current directory")
cmdArgs = append(cmdArgs, args...)
}

cmdArgs = append(cmdArgs, sensitiveArgs...)

log.Debug().Msgf("Executing scan with args: %v", cmdArgs)

cmd := exec.Command(s.cmd, cmdArgs...)

stdout, err := cmd.StdoutPipe()
Expand Down Expand Up @@ -175,7 +168,7 @@ func (s *ScanServicePythonImpl) GetDefaultScanArgs() []string {
}

func (s *ScanServicePythonImpl) GetSensitiveDefaultScanArgs() []string {
args := s.GetDefaultScanArgs()
args := make([]string, 0)
cfg := config.GetInstance()

if cfg.ApiToken != "" {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/StatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { withErrorHandling } from '@/lib/errors';
import useResultsStore from '@/modules/results/stores/useResultsStore';
import useConfigStore from '@/stores/useConfigStore';

import { GetWorkingDir, SelectDirectory, SelectFile } from '../../wailsjs/go/main/App';
import { SelectDirectory, SelectFile } from '../../wailsjs/go/main/App';
import { toast } from './ui/use-toast';

export default function StatusBar() {
Expand Down

0 comments on commit 3529111

Please sign in to comment.