Skip to content

Commit

Permalink
Fix pwsh not executing correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed May 1, 2021
1 parent abd71b2 commit 3ce7306
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ func (s *Step) ShellCommand() string {
case "", "bash":
shellCommand = "bash --login --noprofile --norc -e -o pipefail {0}"
case "pwsh":
shellCommand = "pwsh -login -command . '{0}'"
shellCommand = "pwsh -command . '{0}'"
case "powershell":
shellCommand = "powershell -command . '{0}'"
case "python":
shellCommand = "python {0}"
case "sh":
shellCommand = "sh -l -e -c {0}"
case "cmd":
shellCommand = "%ComSpec% /D /E:ON /V:OFF /S /C \"CALL \"{0}\"\""
case "powershell":
shellCommand = "powershell -command . '{0}'"
default:
shellCommand = s.Shell
}
Expand Down Expand Up @@ -313,12 +313,12 @@ func (s *Step) Type() StepType {
}

func (s *Step) Validate() error {
if s.Type() != StepTypeRun {
return fmt.Errorf("(StepID: %s): Unexpected value 'uses'", s.String())
} else if s.Shell == "" {
return fmt.Errorf("(StepID: %s): Required property is missing: 'shell'", s.String())
}
return nil
if s.Type() != StepTypeRun {
return fmt.Errorf("(StepID: %s): Unexpected value 'uses'", s.String())
} else if s.Shell == "" {
return fmt.Errorf("(StepID: %s): Required property is missing: 'shell'", s.String())
}
return nil
}

// ReadWorkflow returns a list of jobs for a given workflow file reader
Expand Down

0 comments on commit 3ce7306

Please sign in to comment.