-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mod] Add portable products for win linux platform
- Loading branch information
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,33 @@ import { ensureDir } from "https://deno.land/[email protected]/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" | ||
const root = "src-tauri/target/release" | ||
const bundle = root + "/bundle" | ||
|
||
await Deno.mkdir("release") | ||
|
||
// 上传 bundle产物 | ||
for (const dir of dirs) { | ||
ensureDir(`${root}/${dir}`).then(async () => { | ||
if (Deno.statSync(`${root}/${dir}`).isDirectory) { | ||
for await (const file of Deno.readDir(`${root}/${dir}`)) { | ||
ensureDir(`${bundle}/${dir}`).then(async () => { | ||
if (Deno.statSync(`${bundle}/${dir}`).isDirectory) { | ||
for await (const file of Deno.readDir(`${bundle}/${dir}`)) { | ||
if (file.isFile && file.name.startsWith("tran")) { | ||
let name = file.name | ||
name = name.replace("tran", "tran" + "_" + lang) | ||
await Deno.copyFile(`${root}/${dir}/${file.name}`, `release/${name}`) | ||
await Deno.copyFile(`${bundle}/${dir}/${file.name}`, `release/${name}`) | ||
console.log(`release/${name}`) | ||
} | ||
} | ||
} | ||
}) | ||
} | ||
|
||
// 上传 便携产物 | ||
for await (const file of Deno.readDir(root)) { | ||
let name = file.name | ||
if (name == "tran.exe" || name == "tran") { | ||
name = name.replace("tran", "tran" + "_" + lang + "_portable") | ||
await Deno.copyFile(`${root}/${file.name}`, `release/${name}`) | ||
console.log(`release/${name}`) | ||
} | ||
} |