Skip to content

Commit 61bb21b

Browse files
committed
script: Enable SC2155 rule for Gitian scripts
Also pwd command is replaced with $PWD variable everywhere for consistency.
1 parent 577682d commit 61bb21b

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ script: |
5151
export QT_RCC_TEST=1
5252
export QT_RCC_SOURCE_DATE_OVERRIDE=1
5353
export TZ="UTC"
54-
export BUILD_DIR=$(pwd)
54+
export BUILD_DIR="$PWD"
5555
mkdir -p ${WRAP_DIR}
5656
if test -n "$GBUILD_CACHE_ENABLED"; then
5757
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@@ -122,7 +122,7 @@ script: |
122122
done
123123
124124
cd bitcoin
125-
BASEPREFIX=$(pwd)/depends
125+
BASEPREFIX="${PWD}/depends"
126126
# Build dependencies for each host
127127
for i in $HOSTS; do
128128
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
@@ -161,7 +161,7 @@ script: |
161161
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
162162
mkdir -p distsrc-${i}
163163
cd distsrc-${i}
164-
INSTALLPATH=$(pwd)/installed/${DISTNAME}
164+
INSTALLPATH="${PWD}/installed/${DISTNAME}"
165165
mkdir -p ${INSTALLPATH}
166166
tar --strip-components=1 -xf ../$SOURCEDIST
167167

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ script: |
1717
1818
WRAP_DIR=$HOME/wrapped
1919
mkdir -p ${WRAP_DIR}
20-
export PATH=$(pwd):$PATH
20+
export PATH="$PWD":$PATH
2121
FAKETIME_PROGS="dmg genisoimage"
2222
2323
# Create global faketime wrappers

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ script: |
4545
export QT_RCC_TEST=1
4646
export QT_RCC_SOURCE_DATE_OVERRIDE=1
4747
export TZ="UTC"
48-
export BUILD_DIR=$(pwd)
48+
export BUILD_DIR="$PWD"
4949
mkdir -p ${WRAP_DIR}
5050
if test -n "$GBUILD_CACHE_ENABLED"; then
5151
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@@ -86,7 +86,7 @@ script: |
8686
export PATH=${WRAP_DIR}:${PATH}
8787
8888
cd bitcoin
89-
BASEPREFIX=$(pwd)/depends
89+
BASEPREFIX="${PWD}/depends"
9090
9191
mkdir -p ${BASEPREFIX}/SDKs
9292
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
@@ -125,7 +125,7 @@ script: |
125125
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
126126
mkdir -p distsrc-${i}
127127
cd distsrc-${i}
128-
INSTALLPATH=$(pwd)/installed/${DISTNAME}
128+
INSTALLPATH="${PWD}/installed/${DISTNAME}"
129129
mkdir -p ${INSTALLPATH}
130130
tar --strip-components=1 -xf ../$SOURCEDIST
131131

contrib/gitian-descriptors/gitian-win-signer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ files:
1919
script: |
2020
set -e -o pipefail
2121
22-
BUILD_DIR=$(pwd)
22+
BUILD_DIR="$PWD"
2323
SIGDIR=${BUILD_DIR}/signature/win
2424
UNSIGNED_DIR=${BUILD_DIR}/unsigned
2525

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ script: |
4040
export QT_RCC_TEST=1
4141
export QT_RCC_SOURCE_DATE_OVERRIDE=1
4242
export TZ="UTC"
43-
export BUILD_DIR=$(pwd)
43+
export BUILD_DIR="$PWD"
4444
mkdir -p ${WRAP_DIR}
4545
if test -n "$GBUILD_CACHE_ENABLED"; then
4646
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@@ -96,7 +96,7 @@ script: |
9696
export PATH=${WRAP_DIR}:${PATH}
9797
9898
cd bitcoin
99-
BASEPREFIX=$(pwd)/depends
99+
BASEPREFIX="${PWD}/depends"
100100
# Build dependencies for each host
101101
for i in $HOSTS; do
102102
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
@@ -131,7 +131,7 @@ script: |
131131
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
132132
mkdir -p distsrc-${i}
133133
cd distsrc-${i}
134-
INSTALLPATH=$(pwd)/installed/${DISTNAME}
134+
INSTALLPATH="${PWD}/installed/${DISTNAME}"
135135
mkdir -p ${INSTALLPATH}
136136
tar --strip-components=1 -xf ../$SOURCEDIST
137137

test/lint/lint-shell.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ disabled_gitian=(
2626
SC2001 # See if you can use ${variable//search/replace} instead.
2727
SC2094 # Make sure not to read and write the same file in the same pipeline.
2828
SC2129 # Consider using { cmd1; cmd2; } >> file instead of individual redirects.
29-
SC2155 # Declare and assign separately to avoid masking return values.
3029
SC2230 # which is non-standard. Use builtin 'command -v' instead.
3130
)
3231

0 commit comments

Comments
 (0)