Skip to content

Commit

Permalink
Fix e2e example check (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Jan 21, 2022
1 parent 2279ece commit fa3f2e5
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions scripts/run-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ echo "=> Running examples..."
echo "=> Building turbo from source..."
cd cli && CGO_ENABLED=0 go build ./cmd/turbo/... && cd ..;
export TURBO_BINARY_PATH=$(pwd)/cli/turbo
export TURBO_VERSION=$(head -n 1 $(pwd)/cli/version.txt)
export TURBO_TAG=$(cat $(pwd)/cli/version.txt | sed -n '2 p')

echo "=> Binary path: TURBO_BINARY_PATH=$TURBO_BINARY_PATH"
echo "=> Local Turbo Version: TURBO_VERSION=$TURBO_VERSION"
echo "=> Moving our own eslint settings out of the way..."
echo "=> Actually running examples for real..."

if [ -f ".eslintrc.js" ]; then
mv .eslintrc.js .eslintrc.js.bak
fi

echo "'env:\n\tTURBO_BINARY_PATH: $TURBO_BINARY_PATH'" > examples/.yarnrc;

function cleanup {
rm -rf node_modules
rm -rf apps/*/node_modules
Expand Down Expand Up @@ -51,6 +54,12 @@ for folder in examples/* ; do
echo "======================================================="
echo "=> checking $folder "
echo "======================================================="

cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json
if [ "$TURBO_TAG" == "canary" ]; then
cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json
fi

if [ "$folder" != "examples/with-pnpm" ]; then

# cleanup
Expand All @@ -77,8 +86,7 @@ for folder in examples/* ; do

cleanup
setup_git

cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json


echo "======================================================="
echo "=> $folder: yarn install"
Expand Down Expand Up @@ -144,4 +152,8 @@ if [[ ! -z $(git status -s | grep -v package.json) ]];then
exit 1
fi

rm -rf examples/.yarnrc;
cat package.json | jq 'del(.packageManager)' | sponge package.json

if [ "$TURBO_TAG" == "canary" ]; then
cat package.json | jq '.devDependencies.turbo = "latest"' | sponge package.json
fi

1 comment on commit fa3f2e5

@vercel
Copy link

@vercel vercel bot commented on fa3f2e5 Jan 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.