fix: EISDIR error when reinstalling package
This commit is contained in:
parent
d07cc31046
commit
16acfd0a10
3 changed files with 18 additions and 65 deletions
|
@ -13,8 +13,8 @@
|
|||
"dependencies": {
|
||||
"chalk": "^5.0.1",
|
||||
"commander": "^9.4.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"lowdb": "^3.0.0",
|
||||
"mv": "^2.1.1",
|
||||
"tar": "^6.1.11",
|
||||
"type-fest": "^2.19.0"
|
||||
},
|
||||
|
@ -22,7 +22,7 @@
|
|||
"@rollup/plugin-commonjs": "^22.0.2",
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@rushstack/eslint-patch": "^1.1.4",
|
||||
"@types/mv": "^2",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/tar": "^6",
|
||||
"@typescript-eslint/eslint-plugin": "^5.35.1",
|
||||
"@typescript-eslint/parser": "^5.35.1",
|
||||
|
@ -31,7 +31,6 @@
|
|||
"rollup": "^2.78.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.33.0",
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "^4.8.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import chalk from 'chalk';
|
||||
import fse from 'fs-extra';
|
||||
import * as lowdb from 'lowdb';
|
||||
import crypto from 'node:crypto';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import tar from 'tar';
|
||||
import mv from 'mv';
|
||||
|
||||
import { parseWahInfo, walk } from '../utils.js';
|
||||
|
||||
|
@ -70,10 +70,7 @@ export default class Install {
|
|||
|
||||
await md5Adapter.write(toWriteToFile);
|
||||
|
||||
await new Promise<void>((res, rej) => {
|
||||
mv(path.join(makeExtractDir, 'ROOT'), path.join(this.options.sysroot), { mkdirp: true }, (err) => { if (err) rej(err); else res(); });
|
||||
});
|
||||
|
||||
await fse.move(path.join(makeExtractDir, 'ROOT'), path.join(this.options.sysroot), { overwrite: true });
|
||||
await fs.promises.rm(path.join(makeExtractDir), { recursive: true, force: true });
|
||||
|
||||
console.log(chalk.bold.green`Package %s has been installed!`, getWahInfo.name);
|
||||
|
|
71
yarn.lock
71
yarn.lock
|
@ -329,6 +329,15 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/fs-extra@npm:^9.0.13":
|
||||
version: 9.0.13
|
||||
resolution: "@types/fs-extra@npm:9.0.13"
|
||||
dependencies:
|
||||
"@types/node": "npm:*"
|
||||
checksum: c46cad9514da52203eeed1cd72cb4caef3540edf2f3d64116febb36a5c5028478d5d3247f3894bb967872872b5aaa2c5628802056c05cd3543562d8ee9c182a0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/http-cache-semantics@npm:*":
|
||||
version: 4.0.1
|
||||
resolution: "@types/http-cache-semantics@npm:4.0.1"
|
||||
|
@ -359,13 +368,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/mv@npm:^2":
|
||||
version: 2.1.2
|
||||
resolution: "@types/mv@npm:2.1.2"
|
||||
checksum: 8d6352b800ab4c17681508ce503e4fdade63fb76c9a4d4413f1cfcf3a8d5b343bdddc9f642f7a37abb4cf37817a5b04f0e613ba86c44ed4a02bba371b4d28a73
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/node@npm:*":
|
||||
version: 18.7.13
|
||||
resolution: "@types/node@npm:18.7.13"
|
||||
|
@ -1569,7 +1571,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fs-extra@npm:^10.0.0":
|
||||
"fs-extra@npm:^10.0.0, fs-extra@npm:^10.1.0":
|
||||
version: 10.1.0
|
||||
resolution: "fs-extra@npm:10.1.0"
|
||||
dependencies:
|
||||
|
@ -1683,19 +1685,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"glob@npm:^6.0.1":
|
||||
version: 6.0.4
|
||||
resolution: "glob@npm:6.0.4"
|
||||
dependencies:
|
||||
inflight: "npm:^1.0.4"
|
||||
inherits: "npm:2"
|
||||
minimatch: "npm:2 || 3"
|
||||
once: "npm:^1.3.0"
|
||||
path-is-absolute: "npm:^1.0.0"
|
||||
checksum: def6efdc7635f6438609500c320b08730a9f9cf2c864312c89f9d24c9de5cb4daff841d0e44ef95e496623e942e105da38b6345489f7394d0285b15b8f1f0813
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6":
|
||||
version: 7.2.3
|
||||
resolution: "glob@npm:7.2.3"
|
||||
|
@ -2294,7 +2283,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minimatch@npm:2 || 3, minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2":
|
||||
"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2":
|
||||
version: 3.1.2
|
||||
resolution: "minimatch@npm:3.1.2"
|
||||
dependencies:
|
||||
|
@ -2389,7 +2378,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mkdirp@npm:^0.5.1, mkdirp@npm:~0.5.1":
|
||||
"mkdirp@npm:^0.5.1":
|
||||
version: 0.5.6
|
||||
resolution: "mkdirp@npm:0.5.6"
|
||||
dependencies:
|
||||
|
@ -2423,17 +2412,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"mv@npm:^2.1.1":
|
||||
version: 2.1.1
|
||||
resolution: "mv@npm:2.1.1"
|
||||
dependencies:
|
||||
mkdirp: "npm:~0.5.1"
|
||||
ncp: "npm:~2.0.0"
|
||||
rimraf: "npm:~2.4.0"
|
||||
checksum: 166fd11f2ba2f87fdac31337f6af4ff81ce6a5f567c933ed009f2d5c291e8ecb2d66326ab8ed8dd3cf4e5a20cd85d817ab028be656a8ac519579e349bc3f8a6b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"natural-compare@npm:^1.4.0":
|
||||
version: 1.4.0
|
||||
resolution: "natural-compare@npm:1.4.0"
|
||||
|
@ -2441,15 +2419,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ncp@npm:~2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "ncp@npm:2.0.0"
|
||||
bin:
|
||||
ncp: ./bin/ncp
|
||||
checksum: f549e0f6616007d54105d4526385cd7ab939cc98af2dfbfde5971c38a5982900cde4c4d0da69df1b6494c98fe7daa6331cc7e8fee9677a2913546d96abfcfbce
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"negotiator@npm:^0.6.3":
|
||||
version: 0.6.3
|
||||
resolution: "negotiator@npm:0.6.3"
|
||||
|
@ -2899,17 +2868,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rimraf@npm:~2.4.0":
|
||||
version: 2.4.5
|
||||
resolution: "rimraf@npm:2.4.5"
|
||||
dependencies:
|
||||
glob: "npm:^6.0.1"
|
||||
bin:
|
||||
rimraf: ./bin.js
|
||||
checksum: 8a9ca22efee963d393072fdb51007dedba194b9306a6dc43b774f73f5ce43fd5c8cdb312bee7bf61d750716428f31209abd090b83886c59c781c7bbab8fa74d0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rollup-plugin-terser@npm:^7.0.2":
|
||||
version: 7.0.2
|
||||
resolution: "rollup-plugin-terser@npm:7.0.2"
|
||||
|
@ -3395,7 +3353,7 @@ __metadata:
|
|||
"@rollup/plugin-commonjs": "npm:^22.0.2"
|
||||
"@rollup/plugin-node-resolve": "npm:^13.3.0"
|
||||
"@rushstack/eslint-patch": "npm:^1.1.4"
|
||||
"@types/mv": "npm:^2"
|
||||
"@types/fs-extra": "npm:^9.0.13"
|
||||
"@types/tar": "npm:^6"
|
||||
"@typescript-eslint/eslint-plugin": "npm:^5.35.1"
|
||||
"@typescript-eslint/parser": "npm:^5.35.1"
|
||||
|
@ -3403,13 +3361,12 @@ __metadata:
|
|||
chalk: "npm:^5.0.1"
|
||||
commander: "npm:^9.4.0"
|
||||
eslint: "npm:^8.23.0"
|
||||
fs-extra: "npm:^10.1.0"
|
||||
lowdb: "npm:^3.0.0"
|
||||
mv: "npm:^2.1.1"
|
||||
rollup: "npm:^2.78.1"
|
||||
rollup-plugin-terser: "npm:^7.0.2"
|
||||
rollup-plugin-typescript2: "npm:^0.33.0"
|
||||
tar: "npm:^6.1.11"
|
||||
tslib: "npm:^2.4.0"
|
||||
type-fest: "npm:^2.19.0"
|
||||
typescript: "npm:^4.8.2"
|
||||
bin:
|
||||
|
|
Reference in a new issue