sticky-note-cli 3.1.38 → 3.1.39
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/cli.js +8 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -624,7 +624,14 @@ async function cmdInit() {
|
|
|
624
624
|
print(" [ERR] Not a git repository. Run `git init` first.");
|
|
625
625
|
process.exit(1);
|
|
626
626
|
}
|
|
627
|
-
|
|
627
|
+
// Resolve git root and chdir there so init works from any subdirectory
|
|
628
|
+
const repoRoot = execSync("git rev-parse --show-toplevel", { encoding: "utf-8" }).trim();
|
|
629
|
+
if (repoRoot !== process.cwd()) {
|
|
630
|
+
process.chdir(repoRoot);
|
|
631
|
+
print(` [OK] Git repository detected (running from root: ${repoRoot})`);
|
|
632
|
+
} else {
|
|
633
|
+
print(" [OK] Git repository detected");
|
|
634
|
+
}
|
|
628
635
|
print("");
|
|
629
636
|
|
|
630
637
|
// Read existing sticky-note-config.json for teammate flow (cloud URL pre-set via git)
|