From 1592d9a1060acafc3384f8d88e80ba227946cae6 Mon Sep 17 00:00:00 2001 From: Benjamin Dupont <4503241+Benjozork@users.noreply.github.com> Date: Mon, 9 Oct 2023 02:09:32 -0400 Subject: [PATCH] build: remove nuking of node_modules/ in setup.sh (#8245) * build: remove nuking of node_modules/ in setup.sh * build+ci: add --clean flag to setup.sh to clean node_modules/ --- .github/workflows/experimental.yml | 2 +- .github/workflows/ingamepanels-checklist-fix.yml | 4 ++-- .github/workflows/master.yml | 2 +- .github/workflows/pr.yml | 6 +++--- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- scripts/setup.sh | 9 ++++++++- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 9071ada83ac..ecaacfddfa2 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -33,7 +33,7 @@ jobs: echo VITE_BUILD=false >> .env - name: Build A32NX run: | - ./scripts/dev-env/run.sh ./scripts/setup.sh + ./scripts/dev-env/run.sh ./scripts/setup.sh --clean ./scripts/dev-env/run.sh ./scripts/build_a32nx.sh --no-tty -j 4 - name: Build ZIP files run: | diff --git a/.github/workflows/ingamepanels-checklist-fix.yml b/.github/workflows/ingamepanels-checklist-fix.yml index 882adb50142..0b73d0733b8 100644 --- a/.github/workflows/ingamepanels-checklist-fix.yml +++ b/.github/workflows/ingamepanels-checklist-fix.yml @@ -13,7 +13,7 @@ on: jobs: build-ingamepanels-checklist-fix: - # Prevent running this on forks + # Prevent running this on forks if: github.repository_owner == 'flybywiresim' name: 'Build InGamePanels Checklist Fix' runs-on: ubuntu-latest @@ -38,7 +38,7 @@ jobs: echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env - name: Build In-Game Panels Checklist Fix run: | - ./scripts/dev-env/run.sh ./scripts/setup.sh + ./scripts/dev-env/run.sh ./scripts/setup.sh --clean ./scripts/dev-env/run.sh ./scripts/build_ingamepanels_checklist_fix.sh --no-tty -j 4 - name: Build ZIP files run: | diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index e3a810f8d2d..8f0af4b7b3d 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -35,7 +35,7 @@ jobs: echo VITE_BUILD=false >> .env - name: Build A32NX run: | - ./scripts/dev-env/run.sh ./scripts/setup.sh + ./scripts/dev-env/run.sh ./scripts/setup.sh --clean ./scripts/dev-env/run.sh ./scripts/build_a32nx.sh --no-tty -j 4 rm -rf fbw-a32nx/src - name: Build ZIP files diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 419b046cec3..fb7447543df 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout source uses: actions/checkout@v2 - name: install - run: ./scripts/dev-env/run.sh ./scripts/setup.sh + run: ./scripts/dev-env/run.sh ./scripts/setup.sh --clean - name: npm run lint run: ./scripts/dev-env/run.sh npm run lint - name: lint-rust.sh @@ -37,7 +37,7 @@ jobs: - name: Checkout source uses: actions/checkout@v2 - name: npm install - run: ./scripts/dev-env/run.sh ./scripts/setup.sh + run: ./scripts/dev-env/run.sh ./scripts/setup.sh --clean - name: npm test run: npm test build: @@ -62,7 +62,7 @@ jobs: cat fbw-a32nx/.env - name: Build A32NX run: | - ./scripts/dev-env/run.sh ./scripts/setup.sh + ./scripts/dev-env/run.sh ./scripts/setup.sh --clean ./scripts/dev-env/run.sh ./scripts/build.sh --no-tty -j 4 rm -rf fbw-a32nx/src - name: Generate install.json diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index c0a40cd5596..8c3eabaff4e 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -27,7 +27,7 @@ jobs: echo VITE_BUILD=false >> .env - name: Build A32NX run: | - ./scripts/dev-env/run.sh ./scripts/setup.sh + ./scripts/dev-env/run.sh ./scripts/setup.sh --clean ./scripts/dev-env/run.sh ./scripts/build.sh --no-tty -j 4 - name: Build ZIP file run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b4dccb12c3..a632f211cca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: echo VITE_BUILD=false >> .env - name: Build A32NX run: | - ./scripts/dev-env/run.sh ./scripts/setup.sh + ./scripts/dev-env/run.sh ./scripts/setup.sh --clean ./scripts/dev-env/run.sh ./scripts/build.sh --no-tty -j 4 - name: Build ZIP file run: | diff --git a/scripts/setup.sh b/scripts/setup.sh index 1575951c342..11357e06149 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -3,5 +3,12 @@ set -ex cd /external -rm -rf node_modules + +for arg in "$@"; do + if [ "$arg" = "--clean" ]; then + echo "Removing node_modules..." + rm -rf node_modules/ + fi +done + npm ci