Skip to content

Commit ba53cbd

Browse files
committed
fix: let's check for a cache hit before cloning
1 parent 6a38828 commit ba53cbd

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.circleci/build-cli.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
echo "Cloning CLI repo"
44
cd ~
5-
git clone https://github.com/snyk/cli.git
5+
# If the CLI repo doesn't exist (due to caching), clone it
6+
if [ ! -d "~/cli" ]; then
7+
echo "Cloning CLI repo"
8+
git clone https://github.com/snyk/cli.git
9+
else
10+
echo "CLI repo already exists from cache"
11+
fi
12+
613
cd cli
714
echo "Replacing snyk-docker-plugin dependency with SHA $CIRCLE_SHA1"
815
sed -iE "s/\"snyk-docker-plugin\": \".*\",/\"snyk-docker-plugin\": \"git:\/\/github.com\/snyk\/snyk-docker-plugin.git#$CIRCLE_SHA1\",/" package.json
16+
917
sudo npm i -g npm@7
18+
1019
echo "Running npm install"
1120
npm i
21+
1222
echo "Running build"
1323
npm run build

0 commit comments

Comments
 (0)