create-seedcord 0.3.0 → 0.3.1

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/index.mjs CHANGED
@@ -2465,7 +2465,7 @@ function isSeedcordError(error, type, code) {
2465
2465
 
2466
2466
  //#endregion
2467
2467
  //#region src/cli/banner.ts
2468
- function banner(version = "0.3.0") {
2468
+ function banner(version = "0.3.1") {
2469
2469
  const wordmark = `${paint.flesh.bold("seed")}${paint.rind.bold("cord")}${paint.mute(" create")}`;
2470
2470
  if (version === void 0) return wordmark;
2471
2471
  return `${wordmark}${paint.pith(` • v${version}`)}`;
@@ -3594,11 +3594,11 @@ const CANCELLED = {
3594
3594
  };
3595
3595
  function reportFailure(error) {
3596
3596
  if (isSeedcordError(error, void 0, SeedcordErrorCode.CreateCancelled)) return CANCELLED;
3597
- const removed = isSeedcordError(error, void 0, SeedcordErrorCode.CreateStepFailed);
3597
+ const kept = isSeedcordError(error, void 0, SeedcordErrorCode.CreateStepFailed);
3598
3598
  return {
3599
3599
  code: 1,
3600
3600
  message: isSeedcordError(error) || Error.isError(error) ? error.message : String(error),
3601
- closing: removed ? "Nothing was kept." : "Nothing was created."
3601
+ closing: kept ? "Project kept. Run the command manually." : "Nothing was created."
3602
3602
  };
3603
3603
  }
3604
3604
 
@@ -11187,6 +11187,7 @@ async function scaffold(input, run) {
11187
11187
  const parent = dirname(input.target);
11188
11188
  await mkdir(parent, { recursive: true });
11189
11189
  const plan = gitPlanFrom(await probeGit(parent), input.git);
11190
+ let written = false;
11190
11191
  try {
11191
11192
  const context = buildContext(input.answers, {
11192
11193
  developerUsername: plan.developerUsername,
@@ -11200,6 +11201,7 @@ async function scaffold(input, run) {
11200
11201
  await mkdir(input.target, { recursive: true });
11201
11202
  await writeTree(input.target, await renderTemplates(input.templatesRoot, context));
11202
11203
  });
11204
+ written = true;
11203
11205
  if (input.install) await runInstallSteps(input, run, context.isGateway);
11204
11206
  else {
11205
11207
  steps.skip("Dependencies installed");
@@ -11214,11 +11216,13 @@ async function scaffold(input, run) {
11214
11216
  gitNotice
11215
11217
  };
11216
11218
  } catch (error) {
11217
- await rm(input.target, {
11218
- recursive: true,
11219
- force: true
11220
- });
11221
- if (existed) await mkdir(input.target, { recursive: true });
11219
+ if (!written) {
11220
+ await rm(input.target, {
11221
+ recursive: true,
11222
+ force: true
11223
+ });
11224
+ if (existed) await mkdir(input.target, { recursive: true });
11225
+ }
11222
11226
  throw error;
11223
11227
  }
11224
11228
  }