create-golden 1.4.8 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const os = require('os');
|
|
|
10
10
|
const GITHUB_REPO = 'kuidream/golden-base-specs';
|
|
11
11
|
const GITHUB_BRANCH = 'main';
|
|
12
12
|
const GITHUB_API_URL = `https://api.github.com/repos/${GITHUB_REPO}/zipball/${GITHUB_BRANCH}`;
|
|
13
|
-
const EXCLUDE_DIRS = ['node_modules', 'dist', '.ray', '.DS_Store'];
|
|
13
|
+
const EXCLUDE_DIRS = ['node_modules', 'dist', '.ray', '.DS_Store', 'VI spec'];
|
|
14
14
|
const TOKEN_FILE = path.join(os.homedir(), '.create-golden-token');
|
|
15
15
|
|
|
16
16
|
async function downloadFile(url, dest, token) {
|
|
@@ -53,15 +53,7 @@ async function downloadFile(url, dest, token) {
|
|
|
53
53
|
|
|
54
54
|
function shouldExclude(filePath) {
|
|
55
55
|
const parts = filePath.split(path.sep);
|
|
56
|
-
|
|
57
|
-
if (EXCLUDE_DIRS.some(dir => parts.includes(dir))) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
// 排除 VI spec 目录(注意路径中可能有空格)
|
|
61
|
-
if (filePath.includes('VI spec') || filePath.includes('VI spec/') || filePath.includes('VI spec\\')) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
return false;
|
|
56
|
+
return EXCLUDE_DIRS.some(dir => parts.includes(dir));
|
|
65
57
|
}
|
|
66
58
|
|
|
67
59
|
async function extractZip(zipPath, extractTo) {
|