From cdaf7396bdba9ec87011f7bed5f724ad1ebc7073 Mon Sep 17 00:00:00 2001 From: Borber Date: Wed, 22 Nov 2023 00:48:30 +0800 Subject: [PATCH] Update --- .github/workflows/release.yml | 4 +--- script/tag.ts | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c44483..95c27a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,4 @@ jobs: - name: Add tag env: MATRIX_LANG: ${{ matrix.lang }} - run: | - cd src-tauri/target/release/bundle - deno run -A script/tag.ts + run: deno run -A script/tag.ts diff --git a/script/tag.ts b/script/tag.ts index 58fa77b..486b0bd 100644 --- a/script/tag.ts +++ b/script/tag.ts @@ -1,15 +1,16 @@ const dirs = ["msi", "nsis", "deb", "appimage", "dmg", "macos",] const lang = Deno.env.get("MATRIX_LANG") +const root = "../src-tauri/target/release/bundle" for (const dir of dirs) { - if (Deno.statSync(`./${dir}`).isDirectory) { + if (Deno.statSync(`${root}/${dir}`).isDirectory) { for await (const file of Deno.readDir(dir)) { if (file.isFile && file.name.startsWith("tran")) { let name = file.name name = name.replace("tran", "tran" + "_" + lang) - Deno.renameSync(`./${dir}/${file.name}`, `./${dir}/${name}`) - console.log(`./${dir}/${name}`) + Deno.renameSync(`${root}/${file.name}`, `${root}/${name}`) + console.log(`${root}/${name}`) } } }