Simpler Tauri resource paths (#112)

This commit is contained in:
Gregory Schier
2024-09-25 09:25:51 -07:00
committed by GitHub
parent d2c33f821c
commit 2be45d6101
8 changed files with 18 additions and 16 deletions

1
scripts/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
tmp-*

View File

@@ -47,10 +47,11 @@ if (existsSync(binDest) && tryExecSync(`${binDest} --version`).trim() === NODE_V
rmSync(destDir, { recursive: true, force: true });
mkdirSync(destDir, { recursive: true });
(async function () {
const url = URL_MAP[key];
const tmpDir = path.join(__dirname, 'tmp', Date.now().toString());
const url = URL_MAP[key];
const tmpDir = path.join(__dirname, 'tmp-node');
rmSync(tmpDir, { recursive: true, force: true });
(async function () {
// Download GitHub release artifact
const { filePath } = await new Downloader({ url, directory: tmpDir }).download();

View File

@@ -38,7 +38,7 @@ const key = `${process.platform}_${process.env.YAAK_TARGET_ARCH ?? process.arch}
console.log(`Vendoring protoc ${VERSION} for ${key}`);
const url = URL_MAP[key];
const tmpDir = path.join(__dirname, 'tmp', Date.now().toString());
const tmpDir = path.join(__dirname, 'tmp-protoc');
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
const binDst = path.join(dstDir, DST_BIN_MAP[key]);
@@ -47,6 +47,7 @@ if (existsSync(binDst) && tryExecSync(`${binDst} --version`).trim().includes(VER
return;
}
rmSync(tmpDir, { recursive: true, force: true });
rmSync(dstDir, { recursive: true, force: true });
mkdirSync(dstDir, { recursive: true });
@@ -64,7 +65,6 @@ mkdirSync(dstDir, { recursive: true });
const includeSrc = path.join(tmpDir, 'include');
const includeDst = path.join(dstDir, 'include');
cpSync(includeSrc, includeDst, { recursive: true });
rmSync(tmpDir, { recursive: true, force: true });
console.log('Downloaded protoc to', binDst);