Skip to content

Commit

Permalink
rm start return status
Browse files Browse the repository at this point in the history
  • Loading branch information
ovcharenko-di committed Nov 17, 2024
1 parent 41ff0eb commit 611dbc8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ru/pulsar/jenkins/library/IStepExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface IStepExecutor {

def ringCommand(String script)

void start(String script, boolean returnStatus)
void start(String script)

void tool(String toolName)

Expand Down
4 changes: 2 additions & 2 deletions src/ru/pulsar/jenkins/library/StepExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class StepExecutor implements IStepExecutor {
}

@Override
void start(String script, boolean returnStatus = false) {
steps.start(script, returnStatus)
void start(String script) {
steps.start(script)
}

@Override
Expand Down
8 changes: 3 additions & 5 deletions src/ru/pulsar/jenkins/library/steps/Start.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ import ru.pulsar.jenkins.library.ioc.ContextRegistry
class Start implements Serializable {

private String script
private boolean returnStatus
private String encoding = 'UTF-8'

Start(String script, boolean returnStatus = false) {
Start(String script) {
this.script = script
this.returnStatus = returnStatus
};

void run() {
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()

if (steps.isUnix()) {
steps.sh("$script &", returnStatus, encoding)
steps.sh("$script &", false, false , encoding)
} else {
steps.bat("chcp 65001 > nul \nstart $script", returnStatus, encoding)
steps.bat("chcp 65001 > nul \nstart $script", false, false, encoding)
}
}
}
4 changes: 2 additions & 2 deletions vars/start.groovy
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ru.pulsar.jenkins.library.steps.Start
import ru.pulsar.jenkins.library.ioc.ContextRegistry

void call(String script, boolean returnStatus = false) {
void call(String script) {
ContextRegistry.registerDefaultContext(this)

Start start = new Start(script, returnStatus)
Start start = new Start(script)
start.run()
}

0 comments on commit 611dbc8

Please sign in to comment.