From b159c151aed21474f5b867ae747473753c9ed37d Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sat, 2 Sep 2023 19:38:52 +0200 Subject: [PATCH] feat: remove old scripts folder on start --- .github/workflows/release.yml | 1 + packages/cli/src/executors/system/system.helpers.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8482cfd4..d4291ea1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,6 +54,7 @@ jobs: build-cli: runs-on: ubuntu-latest + timeout-minutes: 10 needs: get-tag steps: - name: Checkout code diff --git a/packages/cli/src/executors/system/system.helpers.ts b/packages/cli/src/executors/system/system.helpers.ts index abef4874..df386269 100644 --- a/packages/cli/src/executors/system/system.helpers.ts +++ b/packages/cli/src/executors/system/system.helpers.ts @@ -217,6 +217,12 @@ export const setEnvVariable = async (key: EnvKeys, value: string) => { * Copies the system files from the assets folder to the current working directory */ export const copySystemFiles = async () => { + // Remove old unused files + if (await pathExists(path.join(process.cwd(), 'scripts'))) { + fileLogger.info('Removing old scripts folder'); + await fs.promises.rmdir(path.join(process.cwd(), 'scripts'), { recursive: true }); + } + const assetsFolder = path.join('/snapshot', 'runtipi', 'packages', 'cli', 'assets'); // Copy docker-compose.yml file