mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:38:26 +02:00
Refine vendor scripts
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const decompress = require('decompress');
|
const decompress = require('decompress');
|
||||||
const Downloader = require("nodejs-file-downloader");
|
const Downloader = require("nodejs-file-downloader");
|
||||||
const {rmSync, unlinkSync, cpSync, mkdirSync, existsSync} = require("node:fs");
|
const {rmSync, cpSync, mkdirSync, existsSync} = require("node:fs");
|
||||||
const {execSync} = require("node:child_process");
|
const {execSync} = require("node:child_process");
|
||||||
|
|
||||||
const NODE_VERSION = 'v22.5.1';
|
const NODE_VERSION = 'v22.5.1';
|
||||||
@@ -58,7 +58,7 @@ mkdirSync(destDir, {recursive: true});
|
|||||||
await decompress(filePath, tmpDir, {});
|
await decompress(filePath, tmpDir, {});
|
||||||
|
|
||||||
// Remove the original archive
|
// Remove the original archive
|
||||||
unlinkSync(filePath);
|
rmSync(filePath);
|
||||||
|
|
||||||
// Copy binary
|
// Copy binary
|
||||||
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
|
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
const decompress = require('decompress');
|
const decompress = require('decompress');
|
||||||
const Downloader = require("nodejs-file-downloader");
|
const Downloader = require("nodejs-file-downloader");
|
||||||
const path = require("node:path");
|
const path = require("node:path");
|
||||||
const fs = require("node:fs");
|
const {rmSync, mkdirSync, cpSync} = require("node:fs");
|
||||||
const {rmSync, mkdirSync} = require("node:fs");
|
|
||||||
|
|
||||||
// `${process.platform}_${process.arch}`
|
// `${process.platform}_${process.arch}`
|
||||||
const MAC_ARM = 'darwin_arm64';
|
const MAC_ARM = 'darwin_arm64';
|
||||||
@@ -48,17 +47,17 @@ mkdirSync(dstDir, {recursive: true});
|
|||||||
await decompress(filePath, tmpDir, {});
|
await decompress(filePath, tmpDir, {});
|
||||||
|
|
||||||
// Remove the original archive
|
// Remove the original archive
|
||||||
fs.unlinkSync(filePath);
|
rmSync(filePath);
|
||||||
|
|
||||||
// Copy binary
|
// Copy binary
|
||||||
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
|
const binSrc = path.join(tmpDir, SRC_BIN_MAP[key]);
|
||||||
const binDst = path.join(dstDir, DST_BIN_MAP[key]);
|
const binDst = path.join(dstDir, DST_BIN_MAP[key]);
|
||||||
fs.cpSync(binSrc, binDst);
|
cpSync(binSrc, binDst);
|
||||||
|
|
||||||
// Copy other files
|
// Copy other files
|
||||||
const includeSrc = path.join(tmpDir, 'include');
|
const includeSrc = path.join(tmpDir, 'include');
|
||||||
const includeDst = path.join(dstDir, 'include');
|
const includeDst = path.join(dstDir, 'include');
|
||||||
fs.cpSync(includeSrc, includeDst, {recursive: true});
|
cpSync(includeSrc, includeDst, {recursive: true});
|
||||||
|
|
||||||
rmSync(tmpDir, {recursive: true, force: true});
|
rmSync(tmpDir, {recursive: true, force: true});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user