mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Install script extension (#19012)
Because windows won't run powershell scripts without it 👎
This commit is contained in:
parent
da85d91551
commit
6e8e1bd0b4
1 changed files with 7 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
|
@ -212,7 +213,11 @@ func (r *Runner) installSoftware(ctx context.Context, installID string) (*fleet.
|
|||
}
|
||||
}()
|
||||
|
||||
installOutput, installExitCode, err := r.runInstallerScript(ctx, installer.InstallScript, installerPath, "install-script")
|
||||
scriptExtension := ".sh"
|
||||
if runtime.GOOS == "windows" {
|
||||
scriptExtension = ".ps1"
|
||||
}
|
||||
installOutput, installExitCode, err := r.runInstallerScript(ctx, installer.InstallScript, installerPath, "install-script"+scriptExtension)
|
||||
payload.InstallScriptOutput = &installOutput
|
||||
payload.InstallScriptExitCode = &installExitCode
|
||||
if err != nil {
|
||||
|
|
@ -220,7 +225,7 @@ func (r *Runner) installSoftware(ctx context.Context, installID string) (*fleet.
|
|||
}
|
||||
|
||||
if installer.PostInstallScript != "" {
|
||||
postOutput, postExitCode, postErr := r.runInstallerScript(ctx, installer.PostInstallScript, installerPath, "post-install-script")
|
||||
postOutput, postExitCode, postErr := r.runInstallerScript(ctx, installer.PostInstallScript, installerPath, "post-install-script"+scriptExtension)
|
||||
payload.PostInstallScriptOutput = &postOutput
|
||||
payload.PostInstallScriptExitCode = &postExitCode
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue