@sleekcms/sync 1.2.0 ā 1.2.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/dist/cli.js +9 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -95,14 +95,14 @@ function setupKeyboardInput(handlers) {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
const EDITOR_CANDIDATES = [
|
|
99
|
+
{ name: "VS Code", cmd: "code", args: (dir) => ["-n", dir] },
|
|
100
|
+
{ name: "Cursor", cmd: "cursor", args: (dir) => ["-n", dir] },
|
|
101
|
+
];
|
|
98
102
|
function showEditorMenu(viewsDir, handlers) {
|
|
99
|
-
const editors =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
if (commandExists("cursor")) {
|
|
104
|
-
editors.push({ key: "2", name: "Cursor", cmd: "cursor" });
|
|
105
|
-
}
|
|
103
|
+
const editors = EDITOR_CANDIDATES
|
|
104
|
+
.filter(e => commandExists(e.cmd))
|
|
105
|
+
.map((e, i) => ({ ...e, key: String(i + 1) }));
|
|
106
106
|
if (editors.length === 0) {
|
|
107
107
|
console.log("\nš Watching for changes...");
|
|
108
108
|
showWatchHelp();
|
|
@@ -135,9 +135,10 @@ function showEditorMenu(viewsDir, handlers) {
|
|
|
135
135
|
const selected = editors.find(e => e.key === answer.trim());
|
|
136
136
|
if (selected) {
|
|
137
137
|
console.log(`š Watching for changes... (opened ${selected.name})`);
|
|
138
|
-
(0, child_process_1.spawn)(selected.cmd,
|
|
138
|
+
(0, child_process_1.spawn)(selected.cmd, selected.args(viewsDir), {
|
|
139
139
|
detached: true,
|
|
140
140
|
stdio: "ignore",
|
|
141
|
+
...(selected.cwd ? { cwd: selected.cwd(viewsDir) } : {}),
|
|
141
142
|
}).unref();
|
|
142
143
|
}
|
|
143
144
|
else {
|
package/package.json
CHANGED