Skip to content

Commit

Permalink
Merge pull request #979 from zrquan/fix#970
Browse files Browse the repository at this point in the history
ignore default paths if -scp is provided
  • Loading branch information
Mzack9999 authored Sep 10, 2024
2 parents 86bb9e4 + cdc224e commit 0ab8cf8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/engine/hybrid/hybrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ func buildChromeLauncher(options *types.CrawlerOptions, dataStore string) (*laun
UserDataDir(dataStore)

if options.Options.UseInstalledChrome {
if chromePath, hasChrome := launcher.LookPath(); hasChrome {
chromeLauncher.Bin(chromePath)
if options.Options.SystemChromePath != "" {
chromeLauncher.Bin(options.Options.SystemChromePath)
} else {
return nil, errorutil.NewWithTag("hybrid", "the chrome browser is not installed").WithLevel(errorutil.Fatal)
if chromePath, hasChrome := launcher.LookPath(); hasChrome {
chromeLauncher.Bin(chromePath)
} else {
return nil, errorutil.NewWithTag("hybrid", "the chrome browser is not installed").WithLevel(errorutil.Fatal)
}
}
}
if options.Options.SystemChromePath != "" {
Expand Down

0 comments on commit 0ab8cf8

Please sign in to comment.