@webhikers/cli 1.1.17 → 1.1.19
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/create.js +9 -12
package/package.json
CHANGED
package/src/commands/create.js
CHANGED
|
@@ -128,16 +128,7 @@ export async function createCommand(name) {
|
|
|
128
128
|
writeFileSync(resolve(projectDir, ".env"), envContent, "utf-8");
|
|
129
129
|
console.log(c.green(" ✓ .env written"));
|
|
130
130
|
|
|
131
|
-
// --- 5.
|
|
132
|
-
let gitRepo;
|
|
133
|
-
try {
|
|
134
|
-
gitRepo = runCapture("git remote get-url origin", { cwd: projectDir });
|
|
135
|
-
} catch {
|
|
136
|
-
console.error(c.red("Error: No git remote 'origin' found."));
|
|
137
|
-
process.exit(1);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// --- 6. Setup Coolify deployment ---
|
|
131
|
+
// --- 5. Setup Coolify deployment ---
|
|
141
132
|
console.log(c.cyan("\n4/5 Setting up Coolify deployment..."));
|
|
142
133
|
console.log(` Domain: ${c.bold(domain)}`);
|
|
143
134
|
|
|
@@ -183,7 +174,7 @@ export async function createCommand(name) {
|
|
|
183
174
|
});
|
|
184
175
|
console.log(c.green(" ✓ Coolify project configured"));
|
|
185
176
|
|
|
186
|
-
// --- 7. Write .deploy.json ---
|
|
177
|
+
// --- 7. Write .deploy.json + enable sync guard ---
|
|
187
178
|
console.log(c.cyan("\n5/5 Writing .deploy.json..."));
|
|
188
179
|
const deployConfig = {
|
|
189
180
|
serverIp: config.serverIp,
|
|
@@ -196,7 +187,13 @@ export async function createCommand(name) {
|
|
|
196
187
|
JSON.stringify(deployConfig, null, 2) + "\n",
|
|
197
188
|
"utf-8"
|
|
198
189
|
);
|
|
199
|
-
|
|
190
|
+
writeFileSync(
|
|
191
|
+
resolve(projectDir, ".sync-guard.json"),
|
|
192
|
+
JSON.stringify({ enabled: true, lastPull: null }, null, 2) + "\n",
|
|
193
|
+
"utf-8"
|
|
194
|
+
);
|
|
195
|
+
run(`git add .deploy.json .sync-guard.json && git commit -m "Enable sync guard + deploy config" && git push`, { cwd: projectDir });
|
|
196
|
+
console.log(c.green(" ✓ .deploy.json + sync guard written"));
|
|
200
197
|
|
|
201
198
|
// --- 8. Summary ---
|
|
202
199
|
console.log("\n" + c.green("═══════════════════════════════════════════"));
|