algomath-extract 1.0.8 → 1.0.10
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/install.js +6 -13
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -365,19 +365,12 @@ const files = fs.readdirSync(sourceDir).filter(f => f.endsWith('.md'));
|
|
|
365
365
|
for (const file of files) {
|
|
366
366
|
const source = path.join(sourceDir, file);
|
|
367
367
|
const dest = path.join(commandDir, file);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
execSync(`sudo cp "${source}" "${dest}"`, { stdio: 'pipe' });
|
|
375
|
-
// Fix ownership after sudo copy
|
|
376
|
-
execSync(`sudo chown $(whoami) "${dest}"`, { stdio: 'pipe' });
|
|
377
|
-
}
|
|
378
|
-
} else if (needsElevated && !isWindows) {
|
|
379
|
-
// Global install with sudo
|
|
380
|
-
execSync(`sudo cp "${source}" "${dest}"`, { stdio: 'pipe' });
|
|
368
|
+
|
|
369
|
+
// For any install that needs elevated permissions, use sudo
|
|
370
|
+
if (needsElevated && !isWindows) {
|
|
371
|
+
// Use sudo to copy (inherit stdio so user sees password prompt), then fix ownership
|
|
372
|
+
execSync(`sudo cp "${source}" "${dest}"`, { stdio: 'inherit' });
|
|
373
|
+
execSync(`sudo chown $(whoami) "${dest}"`, { stdio: 'inherit' });
|
|
381
374
|
} else {
|
|
382
375
|
fs.copyFileSync(source, dest);
|
|
383
376
|
}
|