Skip to content
This repository was archived by the owner on Feb 23, 2018. It is now read-only.

Commit 09c9cfa

Browse files
committed
use if-then instead of conjunction
otherwise the status code is non-zero if the condition is false.
1 parent 1a0f74b commit 09c9cfa

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

archive-nightly

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,38 @@ mkdir jenkins-artifacts
99

1010

1111
# publish-nightly publishes scaladoc, distribution archives
12-
[[ -d build/scaladoc ]] && {
12+
if [[ -d build/scaladoc ]]; then
1313
mkdir -p jenkins-artifacts/build
1414
rsync -rl build/scaladoc jenkins-artifacts/build/
15-
}
15+
fi
1616

1717
# since 2.11.x, we don't publish nightly archives anymore (tgz/zip etc). commenting
1818
# this out also stops publishing archiving them for 2.10.x
19-
#[[ -d dists/archives ]] && {
19+
#if [[ -d dists/archives ]]; then
2020
# mkdir -p jenkins-artifacts/dists
2121
# rsync -rl dists/archives jenkins-artifacts/dists/
22-
#}
22+
#fi
2323

2424
# sbaz is long gone.
25-
#[[ -d dists/sbaz ]] && {
25+
#if [[ -d dists/sbaz ]]; then
2626
# mkdir -p jenkins-artifacts/dists
2727
# rsync -rl dists/sbaz jenkins-artifacts/dists/
28-
#}
28+
#fi
2929

3030
# publish-nightly publishes maven artifacts. this is still in use for 2.10.x.
3131
# for 2.11.x and later, maven nightlies are published directly in scala-nightly-main.
3232
# the dists/maven/latest/build.xml file does not exist for 2.11.x and later, so we test on that.
33-
[[ -e dists/maven/latest/build.xml ]] && {
33+
if [[ -e dists/maven/latest/build.xml ]]; then
3434
mkdir -p jenkins-artifacts/dists
3535
rsync -rl dists/maven jenkins-artifacts/dists/
36-
}
36+
fi
3737

3838
# scala-nightly-signatures checks signatures of scala-library.jar
3939
# disabled - scala-nighlty-signatures is disabled for months.
40-
#[[ -e dists/latest/lib/scala-library.jar ]] && {
40+
#if [[ -e dists/latest/lib/scala-library.jar ]]; then
4141
# mkdir -p jenkins-artifacts/dists/latest/lib
4242
# cp dists/latest/lib/scala-library.jar jenkins-artifacts/dists/latest/lib/scala-library.jar
43-
#}
43+
#fi
4444

4545
tar czf jenkins-artifacts.tgz jenkins-artifacts
4646
rm -rf jenkins-artifacts

job/scala-nightly-main

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ savedState=$?
1313
# publishing.
1414
# this has changed 2.11.x, maven publishing is part of the main build.xml. so we do it here,
1515
# easier than fixing up the archive-nightly script.
16-
[[ $publish == "true" ]] && grep -q '<target name="publish"' build.xml && {
16+
if [[ $publish == "true" ]] && grep -q '<target name="publish"' build.xml; then
1717
ant publish
1818
savedStatePublish=$?
19-
}
19+
fi
2020

2121
$scriptsDir/archive-nightly
2222
exit $(($savedState || $savedStatePublish))

publish-nightly

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ EOM
1717
buildNr=$3
1818
scaladocDir=$4
1919

20-
[[ $publish == "true" ]] && {
20+
if [[ $publish == "true" ]]; then
2121
rm -rf jenkins-artifacts jenkins-artifacts.tgz
2222
wgetFile job/$jobName/$buildNr/artifact/jenkins-artifacts.tgz
2323
tar xzf jenkins-artifacts.tgz
2424

2525
cd jenkins-artifacts
2626

2727
# Archive Scala nightly distribution (no-op by now, we no longer publish nightly tgz/zip/...)
28-
[[ -d dists/archives ]] && {
28+
if [[ -d dists/archives ]]; then
2929
rsync -az dists/archives/ "$nightly_rsync_dest/distributions"
30-
}
30+
fi
3131

3232
# publish scaladoc nightlies
33-
[[ -d build/scaladoc/ ]] && {
33+
if [[ -d build/scaladoc ]]; then
3434
rsync -az build/scaladoc/ "$nightly_rsync_dest/$scaladocDir"
35-
}
35+
fi
3636

3737
# push to the maven repository. in 2.11.x and above, we've already published during the main job
38-
[[ -e dists/maven/latest/build.xml ]] && {
38+
if [[ -e dists/maven/latest/build.xml ]]; then
3939
cd dists/maven/latest
4040
ant deploy -Dsettings.file=$maven_settings_file
41-
}
42-
}
41+
fi
42+
fi
4343
}

0 commit comments

Comments
 (0)