npms-exam-kit 3.0.3 → 3.0.5
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/exam-kit.js +8 -2
- package/package.json +1 -1
package/bin/exam-kit.js
CHANGED
|
@@ -6,7 +6,7 @@ import chalk from 'chalk';
|
|
|
6
6
|
import inquirer from 'inquirer';
|
|
7
7
|
import { exec } from 'child_process';
|
|
8
8
|
import { promisify } from 'util';
|
|
9
|
-
import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync, readdirSync, statSync } from 'fs';
|
|
9
|
+
import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync, readdirSync, statSync, cpSync } from 'fs';
|
|
10
10
|
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = dirname(__filename);
|
|
@@ -532,13 +532,19 @@ async function main(){
|
|
|
532
532
|
// ── INSTALL ──
|
|
533
533
|
log(chalk.bold(`\n Installing ${project} → ${targetDir} ...`));
|
|
534
534
|
|
|
535
|
+
// DEBUG: show source paths
|
|
536
|
+
log(chalk.dim(` Script: ${import.meta.url}`));
|
|
537
|
+
log(chalk.dim(` Projects dir: ${PROJECTS_DIR}`));
|
|
538
|
+
log(chalk.dim(` Source: ${srcDir}`));
|
|
539
|
+
log(chalk.dim(` Source contents: ${inDir(srcDir).join(', ')}`));
|
|
540
|
+
|
|
535
541
|
try{
|
|
536
542
|
// Copy files first (instant — no spinner needed)
|
|
537
543
|
const entries=readdirSync(srcDir);
|
|
538
544
|
for(const entry of entries){
|
|
539
545
|
if(entry==='node_modules')continue;
|
|
540
546
|
const s=join(srcDir,entry),d=join(targetDir,entry);
|
|
541
|
-
if(statSync(s).isDirectory())
|
|
547
|
+
if(statSync(s).isDirectory())cpSync(s,d,{recursive:true,force:true});
|
|
542
548
|
else copyFileSync(s,d);
|
|
543
549
|
}
|
|
544
550
|
log(chalk.green(' ✓ Project files installed'));
|