hexo-theme-shokax 0.4.6-beta1 → 0.4.6-dev1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/toolbox/lib.mjs +11 -3
package/package.json
CHANGED
package/toolbox/lib.mjs
CHANGED
@@ -31,10 +31,18 @@ export async function hoistDeps() {
|
|
31
31
|
pm = "npm install"
|
32
32
|
}
|
33
33
|
try {
|
34
|
-
|
34
|
+
// TODO 使用本地 package.json 解析
|
35
|
+
const res = await (await fetch('https://registry.npmmirror.com/hexo-theme-shokax')).json()
|
36
|
+
const latestV = res['dist-tags'].latest
|
37
|
+
const deps = res.versions[latestV].dependencies
|
35
38
|
const depsList = Object.keys(deps).map(d => `${d}@${deps[d]}`)
|
36
|
-
|
39
|
+
child_process.exec(`${pm} ${depsList.join(' ')}`.trim(), {
|
40
|
+
cwd: hexoRoot
|
41
|
+
}, async (code, stdout, stderr) => {
|
42
|
+
|
43
|
+
})
|
37
44
|
} catch (e) {
|
38
|
-
|
45
|
+
throw e
|
46
|
+
// console.log('Skipping hoisting dependencies.')
|
39
47
|
}
|
40
48
|
}
|