Skip to content

Commit

Permalink
Move location where we set the env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Jan 7, 2025
1 parent bfd6aee commit f00a78c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions orbit/cmd/orbit/orbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,12 @@ func main() {
)
}

if runtime.GOOS == "windows" {
if systemDrive, ok := os.LookupEnv("SystemDrive"); ok {
options = append(options, osquery.WithEnv([]string{fmt.Sprintf("SystemDrive=%s", systemDrive)}))
}
}

var certPath string
if fleetURL != "https://" && c.Bool("insecure") {
proxy, err := insecure.NewTLSProxy(fleetURL)
Expand Down Expand Up @@ -1156,12 +1162,6 @@ func main() {
// override all other flags and flagfile entries.
options = append(options, osquery.WithFlags(c.Args().Slice()))

if runtime.GOOS == "windows" {
if systemDrive, ok := os.LookupEnv("SystemDrive"); ok {
options = append(options, osquery.WithEnv([]string{fmt.Sprintf("SystemDrive=%s", systemDrive)}))
}
}

// Create an osquery runner with the provided options.
r, err := osquery.NewRunner(osquerydPath, options...)
if err != nil {
Expand Down

0 comments on commit f00a78c

Please sign in to comment.