@codihaus/claude-skills 1.6.0 ā 1.6.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/package.json +1 -1
- package/src/commands/init.js +17 -10
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
|
|
42
42
|
export async function init(options) {
|
|
43
43
|
const projectPath = process.cwd();
|
|
44
|
+
let globalDeps = null; // Declare at function level for later use
|
|
44
45
|
|
|
45
46
|
console.log(chalk.bold('\nš Claude Skills Initialization\n'));
|
|
46
47
|
console.log(chalk.gray(`Project: ${projectPath}\n`));
|
|
@@ -48,7 +49,7 @@ export async function init(options) {
|
|
|
48
49
|
// Step 1: Check global dependencies
|
|
49
50
|
if (!options.noDeps) {
|
|
50
51
|
const spinner = ora('Checking system dependencies...').start();
|
|
51
|
-
|
|
52
|
+
globalDeps = await checkGlobalDeps();
|
|
52
53
|
spinner.stop();
|
|
53
54
|
|
|
54
55
|
printDepsReport(globalDeps);
|
|
@@ -78,16 +79,22 @@ export async function init(options) {
|
|
|
78
79
|
|
|
79
80
|
// Offer to install missing Python packages (only if Python is installed)
|
|
80
81
|
const missingPython = globalDeps.python?.filter(p => !p.installed) || [];
|
|
81
|
-
if (hasPython && hasPip && missingPython.length > 0
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
message: `Install missing Python packages (${missingPython.map(p => p.name).join(', ')})? (will try --user first, then sudo if needed)`,
|
|
86
|
-
default: true
|
|
87
|
-
}]);
|
|
88
|
-
|
|
89
|
-
if (installPython) {
|
|
82
|
+
if (hasPython && hasPip && missingPython.length > 0) {
|
|
83
|
+
if (options.yes) {
|
|
84
|
+
// Auto-install when --yes flag is used
|
|
85
|
+
console.log(chalk.cyan(`\nAuto-installing Python packages: ${missingPython.map(p => p.name).join(', ')}`));
|
|
90
86
|
await installPythonDeps(missingPython);
|
|
87
|
+
} else {
|
|
88
|
+
const { installPython } = await inquirer.prompt([{
|
|
89
|
+
type: 'confirm',
|
|
90
|
+
name: 'installPython',
|
|
91
|
+
message: `Install missing Python packages (${missingPython.map(p => p.name).join(', ')})? (will try --user first, then sudo if needed)`,
|
|
92
|
+
default: true
|
|
93
|
+
}]);
|
|
94
|
+
|
|
95
|
+
if (installPython) {
|
|
96
|
+
await installPythonDeps(missingPython);
|
|
97
|
+
}
|
|
91
98
|
}
|
|
92
99
|
} else if (missingPython.length > 0 && (!hasPython || !hasPip)) {
|
|
93
100
|
console.log(chalk.yellow('\nā ļø Python packages are needed but Python/pip is not available.'));
|