fix(pwsh): delegate manual flag on init

This commit is contained in:
Jan De Dobbeleer 2022-10-06 13:59:10 +02:00 committed by Jan De Dobbeleer
parent 02d4e84e4a
commit 55ed6c9f58

View file

@ -155,10 +155,15 @@ func Init(env environment.Environment) string {
if err != nil {
return noExe
}
var additionalParams string
if env.Flags().Strict {
return fmt.Sprintf("(@(& %s init %s --config=%s --print --strict) -join \"`n\") | Invoke-Expression", quotePwshStr(executable), shell, quotePwshStr(env.Flags().Config))
additionalParams += " --strict"
}
return fmt.Sprintf("(@(& %s init %s --config=%s --print) -join \"`n\") | Invoke-Expression", quotePwshStr(executable), shell, quotePwshStr(env.Flags().Config))
if env.Flags().Manual {
additionalParams += " --manual"
}
command := "(@(& %s init %s --config=%s --print%s) -join \"`n\") | Invoke-Expression"
return fmt.Sprintf(command, quotePwshStr(executable), shell, quotePwshStr(env.Flags().Config), additionalParams)
case ZSH, BASH, FISH, CMD:
return PrintInit(env)
case NU: