mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-11-22 10:56:23 +08:00
feat: unified script
This commit is contained in:
parent
9eb1417ada
commit
854c282599
10
package.json
10
package.json
|
@ -6,11 +6,11 @@
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"lint": "vue-cli-service lint",
|
"lint": "vue-cli-service lint",
|
||||||
"prettier": "npx prettier --write ./src",
|
"prettier": "npx prettier --write ./src ./script",
|
||||||
"napi_run": "cd ./NeteaseCloudMusicApi-master && npm run start",
|
"napi:run": "cd ./NeteaseCloudMusicApi-master && npm run start",
|
||||||
"napi_pull": "node script/setup.js v3.45.1",
|
"napi:pull": "node script/pull.js",
|
||||||
"napi_install": "cd ./NeteaseCloudMusicApi-master && npm install",
|
"napi:install": "cd ./NeteaseCloudMusicApi-master && npm install",
|
||||||
"setup": "npm run napi_pull && npm run napi_install"
|
"napi:setup": "npm run napi:pull && npm run napi:install"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|
|
@ -49,7 +49,11 @@ async function download(options, fileName, callback) {
|
||||||
res.on("data", (chunk) => {
|
res.on("data", (chunk) => {
|
||||||
if (len) {
|
if (len) {
|
||||||
cur += chunk.length;
|
cur += chunk.length;
|
||||||
console.log(`Downloading ${fix2((100.0 * cur) / len)}% ${fix2(cur / MEGA)}/${fix2(total)}mb`);
|
console.log(
|
||||||
|
`Downloading ${fix2((100.0 * cur) / len)}% ${fix2(
|
||||||
|
cur / MEGA
|
||||||
|
)}/${fix2(total)}mb`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
res.on("end", () => {
|
res.on("end", () => {
|
||||||
|
@ -93,7 +97,7 @@ async function unzip(source, target) {
|
||||||
download(options, fileName, (text) => {
|
download(options, fileName, (text) => {
|
||||||
console.log(text);
|
console.log(text);
|
||||||
}).then((path) => {
|
}).then((path) => {
|
||||||
console.log(path)
|
console.log(path);
|
||||||
// Unzip process
|
// Unzip process
|
||||||
return unzip(path, dest);
|
return unzip(path, dest);
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user