npms-exam-kit 3.0.1 → 3.0.2
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 +12 -4
- package/package.json +4 -2
package/bin/exam-kit.js
CHANGED
|
@@ -11,7 +11,7 @@ import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync, readd
|
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = dirname(__filename);
|
|
13
13
|
const ROOT = join(__dirname, '..');
|
|
14
|
-
const PROJECTS_DIR =
|
|
14
|
+
const PROJECTS_DIR = fileURLToPath(new URL('../projects', import.meta.url));
|
|
15
15
|
const execAsync = promisify(exec);
|
|
16
16
|
|
|
17
17
|
function read(p) { try { return existsSync(p) ? readFileSync(p, 'utf8') : ''; } catch { return ''; } }
|
|
@@ -521,10 +521,16 @@ async function main(){
|
|
|
521
521
|
}
|
|
522
522
|
|
|
523
523
|
const srcDir=join(PROJECTS_DIR,project==='SIMS'?'SIMS-master':'CRPMS-main');
|
|
524
|
-
if(!existsSync(srcDir)){
|
|
524
|
+
if(!existsSync(srcDir)){
|
|
525
|
+
log(chalk.red(` Error: source not found at: ${srcDir}`));
|
|
526
|
+
log(chalk.dim(` Package root: ${ROOT}`));
|
|
527
|
+
log(chalk.dim(` Projects dir: ${PROJECTS_DIR}`));
|
|
528
|
+
log(chalk.dim(` Available: ${existsSync(PROJECTS_DIR) ? inDir(PROJECTS_DIR).join(', ') : 'PROJECTS_DIR missing'}`));
|
|
529
|
+
process.exit(1);
|
|
530
|
+
}
|
|
525
531
|
|
|
526
|
-
|
|
527
|
-
log(chalk.bold(`\n Installing ${project}...`));
|
|
532
|
+
// ── INSTALL ──
|
|
533
|
+
log(chalk.bold(`\n Installing ${project} → ${targetDir} ...`));
|
|
528
534
|
const spinChars=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
|
|
529
535
|
let si=0;
|
|
530
536
|
const spin=setInterval(()=>{process.stdout.write(`\r ${chalk.cyan(spinChars[si++%spinChars.length])} Installing...`);},80);
|
|
@@ -555,6 +561,8 @@ async function main(){
|
|
|
555
561
|
clearInterval(spin);
|
|
556
562
|
process.stdout.write('\r \r');
|
|
557
563
|
log(chalk.green(' ✓ Project files installed\n'));
|
|
564
|
+
log(chalk.dim(` Files created:`));
|
|
565
|
+
for(const f of readdirSync(targetDir).filter(f=>f!=='node_modules'&&f!=='package-lock.json')){log(chalk.dim(` ${f}`));}
|
|
558
566
|
|
|
559
567
|
// Create .env
|
|
560
568
|
if(existsSync(join(beDir,'.env.example'))&&!existsSync(join(beDir,'.env'))){
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npms-exam-kit",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "NESA National Practical Exam Projects Installer - SIMS & CRPMS",
|
|
5
|
-
"bin":
|
|
5
|
+
"bin": {
|
|
6
|
+
"npms-exam-kit": "bin/exam-kit.js"
|
|
7
|
+
},
|
|
6
8
|
"keywords": [
|
|
7
9
|
"nesa",
|
|
8
10
|
"exam",
|