From 2f5394ba357b422da7cc47331a71523bbb73997d Mon Sep 17 00:00:00 2001 From: Luiz Bezerra Date: Fri, 18 Oct 2024 11:14:10 +0100 Subject: [PATCH] moved clean script to a bash script and fixing script to remove folders Signed-off-by: Luiz Bezerra --- ci/clean-build.sh | 24 ++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 ci/clean-build.sh diff --git a/ci/clean-build.sh b/ci/clean-build.sh new file mode 100644 index 0000000000..feee198906 --- /dev/null +++ b/ci/clean-build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Clean and build TypeScript packages +tsc --build --clean packages/**/tsconfig.json + +# Define the folders to be removed in an array +folders_to_remove=( + ".webpack" + "*/.webpack" + "dist" + "storybook-screenshots" + "storybook-static" + "coverage" + "desktop/integration-test/coverage" + "web/integration-test/coverage" +) + +# Remove the folders +for folder in "${folders_to_remove[@]}"; do + rimraf "$folder" +done + +# Display completion message +echo "Build cleaned and folders removed successfully." diff --git a/package.json b/package.json index 7927e65e8c..947e330e0f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "node": ">=16" }, "scripts": { - "clean": "tsc --build --clean packages/**/tsconfig.json && rimraf .webpack */.webpack dist storybook-screenshots storybook-static coverage", + "clean": "bash ci/clean-build.sh", "build:packages": "tsc --build --verbose packages/*/tsconfig.json packages/*/src/*/tsconfig.json", "desktop:build:dev": "webpack --mode development --progress --config desktop/webpack.config.ts", "desktop:build:prod": "webpack --mode production --progress --config desktop/webpack.config.ts",