create-tengits-app 1.1.2 → 1.1.3
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/bin/cli.js +12 -10
- package/package.json +1 -1
- package/packages/docs/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -191,7 +191,6 @@ const createProject = async () => {
|
|
|
191
191
|
const excludeList = [
|
|
192
192
|
'node_modules',
|
|
193
193
|
'.git',
|
|
194
|
-
'bin',
|
|
195
194
|
'pnpm-lock.yaml',
|
|
196
195
|
'.DS_Store',
|
|
197
196
|
'yarn.lock',
|
|
@@ -208,20 +207,22 @@ const createProject = async () => {
|
|
|
208
207
|
|
|
209
208
|
const copyRecursive = (src, dest) => {
|
|
210
209
|
const stats = fs.statSync(src);
|
|
211
|
-
|
|
210
|
+
|
|
212
211
|
if (stats.isDirectory()) {
|
|
213
212
|
const dirName = path.basename(src);
|
|
214
|
-
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
213
|
+
|
|
218
214
|
fs.ensureDirSync(dest);
|
|
219
215
|
const files = fs.readdirSync(src);
|
|
220
|
-
|
|
216
|
+
|
|
221
217
|
files.forEach(file => {
|
|
222
218
|
const relativePath = path.relative(templateDir, path.join(src, file));
|
|
223
219
|
const shouldKeep = keepFiles.some(keepFile => relativePath === keepFile);
|
|
224
|
-
|
|
220
|
+
|
|
221
|
+
// 对于bin目录,只复制setup-ttos.js文件
|
|
222
|
+
if (dirName === 'bin' && file === 'cli.js') {
|
|
223
|
+
return; // 跳过cli.js文件
|
|
224
|
+
}
|
|
225
|
+
|
|
225
226
|
if (!excludeList.includes(file) || shouldKeep) {
|
|
226
227
|
copyRecursive(path.join(src, file), path.join(dest, file));
|
|
227
228
|
}
|
|
@@ -237,8 +238,9 @@ const createProject = async () => {
|
|
|
237
238
|
if (file !== 'packages') {
|
|
238
239
|
const relativePath = path.relative(templateDir, path.join(templateDir, file));
|
|
239
240
|
const shouldKeep = keepFiles.some(keepFile => relativePath.startsWith(keepFile.split('/')[0]));
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
|
|
242
|
+
// 对于bin目录,总是复制(因为setup-ttos.js需要被保留)
|
|
243
|
+
if (file === 'bin' || !excludeList.includes(file) || shouldKeep) {
|
|
242
244
|
const srcPath = path.join(templateDir, file);
|
|
243
245
|
const destPath = path.join(targetDir, file);
|
|
244
246
|
copyRecursive(srcPath, destPath);
|
package/package.json
CHANGED