Skip to content

Commit bcc39eb

Browse files
authored
Update fetch-source.sh to check if the dir exist before cloning
1 parent 6bb4922 commit bcc39eb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

swift-ci/sdks/static-linux/scripts/fetch-source.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ header "Fetching Swift"
158158
mkdir -p swift-project
159159
pushd swift-project >/dev/null
160160

161-
git clone ${github}apple/swift.git
161+
[[ -d swift ]] || git clone ${github}apple/swift.git
162162
cd swift
163163

164164
# Get its dependencies
@@ -178,47 +178,47 @@ popd >/dev/null
178178
# Fetch Musl (can't clone using ssh)
179179
header "Fetching Musl"
180180

181-
git clone https://git.musl-libc.org/git/musl
181+
[[ -d musl ]] || git clone https://git.musl-libc.org/git/musl
182182
pushd musl >/dev/null 2>&1
183183
git checkout v${MUSL_VERSION}
184184
popd >/dev/null 2>&1
185185

186186
# Fetch libxml2
187187
header "Fetching libxml2"
188188

189-
git clone ${github}GNOME/libxml2.git
189+
[[ -d libxml2 ]] || git clone ${github}GNOME/libxml2.git
190190
pushd libxml2 >/dev/null 2>&1
191191
git checkout v${LIBXML2_VERSION}
192192
popd >/dev/null 2>&1
193193

194194
# Fetch curl
195195
header "Fetching curl"
196196

197-
git clone ${github}curl/curl.git
197+
[[ -d curl ]] || git clone ${github}curl/curl.git
198198
pushd curl >/dev/null 2>&1
199199
git checkout curl-$(echo ${CURL_VERSION} | tr '.' '_')
200200
popd >/dev/null 2>&1
201201

202202
# Fetch BoringSSL (also can't clone using ssh)
203203
header "Fetching BoringSSL"
204204

205-
git clone https://boringssl.googlesource.com/boringssl
205+
[[ -d boringssl ]] || git clone https://boringssl.googlesource.com/boringssl
206206
pushd boringssl >/dev/null 2>&1
207207
git checkout ${BORINGSSL_VERSION}
208208
popd >/dev/null 2>&1
209209

210210
# Fetch ICU
211211
header "Fetching ICU"
212212

213-
git clone ${github}unicode-org/icu.git
213+
[[ -d icu ]] || git clone ${github}unicode-org/icu.git
214214
pushd icu >/dev/null 2>&1
215215
git checkout ${ICU_VERSION}
216216
popd >/dev/null 2>&1
217217

218218
# Fetch zlib
219219
header "Fetching zlib"
220220

221-
git clone ${github}madler/zlib.git
221+
[[ -d zlib ]] || git clone ${github}madler/zlib.git
222222
pushd zlib >/dev/null 2>&1
223223
git checkout v${ZLIB_VERSION}
224224
popd >/dev/null 2>&1

0 commit comments

Comments
 (0)