Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Borber committed Nov 21, 2023
1 parent 30d051f commit 450e907
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions script/tag.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { ensureDir } from "https://deno.land/std/fs/mod.ts";

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(`${root}/${dir}`).isDirectory) {
for await (const file of Deno.readDir(`${root}/${dir}`)) {
if (file.isFile && file.name.startsWith("tran")) {
let name = file.name
name = name.replace("tran", "tran" + "_" + lang)
Deno.renameSync(`${root}/${dir}/${file.name}`, `${root}/${dir}/${name}`)
console.log(`${root}/${dir}/${name}`)
ensureDir(`${root}/${dir}`).then(async () => {
if (Deno.statSync(`${root}/${dir}`).isDirectory) {
for await (const file of Deno.readDir(`${root}/${dir}`)) {
if (file.isFile && file.name.startsWith("tran")) {
let name = file.name
name = name.replace("tran", "tran" + "_" + lang)
Deno.renameSync(`${root}/${dir}/${file.name}`, `${root}/${dir}/${name}`)
console.log(`${root}/${dir}/${name}`)
}
}
}
}
})
}

0 comments on commit 450e907

Please sign in to comment.