ai-native-core 0.2.4 → 0.2.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/package.json +1 -1
- package/src/commands/init.js +7 -1
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const readline = require('readline');
|
|
6
|
+
const { execSync } = require('child_process');
|
|
7
|
+
|
|
8
|
+
function getProjectRoot() {
|
|
9
|
+
try { return execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim(); }
|
|
10
|
+
catch { return process.cwd(); }
|
|
11
|
+
}
|
|
6
12
|
|
|
7
13
|
const VALID_STACKS = ['react-spa', 'nextjs', 'vue', 'backend-go', 'backend-python', 'backend-java'];
|
|
8
14
|
|
|
@@ -76,7 +82,7 @@ function interactiveInit(isForce) {
|
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
function doInit(stacks, isForce, answers = {}) {
|
|
79
|
-
const root =
|
|
85
|
+
const root = getProjectRoot();
|
|
80
86
|
const dirs = ['.ai-native/memory', '.ai-native/hooks', '.ai-native/reports', 'docs/.ai-native/memory', 'docs/decisions'];
|
|
81
87
|
|
|
82
88
|
console.log(`\n[ai-native] Initializing...\n`);
|