A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid looping over single, constant value (codefactor.io/ShellCheck).
[simgrid.git]
/
tools
/
jenkins
/
Flags.sh
diff --git
a/tools/jenkins/Flags.sh
b/tools/jenkins/Flags.sh
index
35f5bc4
..
44ffae8
100755
(executable)
--- a/
tools/jenkins/Flags.sh
+++ b/
tools/jenkins/Flags.sh
@@
-7,16
+7,6
@@
die() {
exit 1
}
exit 1
}
-do_cleanup() {
- for d in "$WORKSPACE/build"
- do
- if [ -d "$d" ]
- then
- rm -rf "$d" || die "Could not remote $d"
- fi
- done
-}
-
# Get an ON/OFF string from a command:
onoff() {
if "$@" > /dev/null ; then
# Get an ON/OFF string from a command:
onoff() {
if "$@" > /dev/null ; then
@@
-33,12
+23,18
@@
onoff() {
! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
[ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
[ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
-do_cleanup
+do_cleanup() {
+ for d
+ do
+ if [ -d "$d" ]
+ then
+ rm -rf "$d" || die "Could not remove $d"
+ fi
+ mkdir "$d" || die "Could not create $d"
+ done
+}
-for d in "$WORKSPACE/build"
-do
- mkdir "$d" || die "Could not create $d"
-done
+do_cleanup "$WORKSPACE/build"
NUMPROC="$(nproc)" || NUMPROC=1
NUMPROC="$(nproc)" || NUMPROC=1