Commit 24cdc07d authored by Andrew Nicols's avatar Andrew Nicols

Task: File vs fileExists

parent 3158d01e
......@@ -74,9 +74,9 @@ class Task {
return pathToRunner
} else if (moodleVersion) {
def runner = "${script.env.HOME}/scripts/runner/${moodleVersion.name}/run.sh"
if (!fileExists(runner)) {
runner = "${script.env.HOME}/scripts/runner/master/run.sh"
def runner = new File("${script.env.HOME}/scripts/runner/${moodleVersion.name}/run.sh")
if (!runner.exists()) {
runner = new File("${script.env.HOME}/scripts/runner/master/run.sh")
}
return runner
......@@ -85,10 +85,10 @@ class Task {
script: 'grep "\\$branch" moodle/version.php | sed "s/^[^\']*\'\\([^\']*\\).*\$/\\1/"',
returnStdout: true
).trim()
def runner = "${script.env.HOME}/scripts/runner/${versionName}/run.sh"
def runner = new File("${script.env.HOME}/scripts/runner/${versionName}/run.sh")
if (!fileExists(runner)) {
runner = "${script.env.HOME}/scripts/runner/master/run.sh"
if (!runner.exists()) {
runner = new File("${script.env.HOME}/scripts/runner/master/run.sh")
}
return runner
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment