@base44-preview/cli 0.1.7-pr.587.23e6e24 → 0.1.7-pr.587.7ed9b75

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/index.js CHANGED
@@ -256660,18 +256660,32 @@ async function runSiteBuild({ runTask: runTask2 }, { root, buildCommand, appId }
256660
256660
  errorMessage: "Build failed"
256661
256661
  });
256662
256662
  }
256663
- async function shouldBuildBeforeDeploy({
256664
- build,
256665
- isNonInteractive,
256666
- buildCommand
256667
- }) {
256668
- if (!buildCommand) {
256669
- return false;
256663
+ async function maybeBuildBeforeDeploy(ctx, project2, build) {
256664
+ if (!ctx.app) {
256665
+ return;
256670
256666
  }
256671
- if (build !== undefined) {
256672
- return build;
256667
+ if (build === true) {
256668
+ await runSiteBuild(ctx, {
256669
+ root: project2.root,
256670
+ buildCommand: project2.site?.buildCommand,
256671
+ appId: ctx.app.id
256672
+ });
256673
+ return;
256674
+ }
256675
+ if (build === false || !project2.site?.outputDirectory) {
256676
+ return;
256677
+ }
256678
+ const shouldBuild = await shouldAskToBuild(ctx.isNonInteractive, project2.site.buildCommand);
256679
+ if (shouldBuild) {
256680
+ await runSiteBuild(ctx, {
256681
+ root: project2.root,
256682
+ buildCommand: project2.site.buildCommand,
256683
+ appId: ctx.app.id
256684
+ });
256673
256685
  }
256674
- if (isNonInteractive) {
256686
+ }
256687
+ async function shouldAskToBuild(isNonInteractive, buildCommand) {
256688
+ if (!buildCommand || isNonInteractive) {
256675
256689
  return false;
256676
256690
  }
256677
256691
  const answer = await Re({
@@ -257017,20 +257031,7 @@ ${summaryLines.join(`
257017
257031
  ${summaryLines.join(`
257018
257032
  `)}`);
257019
257033
  }
257020
- if (ctx.app && project2.site?.outputDirectory) {
257021
- const shouldBuild = await shouldBuildBeforeDeploy({
257022
- build: options.build,
257023
- isNonInteractive,
257024
- buildCommand: project2.site.buildCommand
257025
- });
257026
- if (shouldBuild) {
257027
- await runSiteBuild(ctx, {
257028
- root: project2.root,
257029
- buildCommand: project2.site.buildCommand,
257030
- appId: ctx.app.id
257031
- });
257032
- }
257033
- }
257034
+ await maybeBuildBeforeDeploy(ctx, project2, options.build);
257034
257035
  let functionCompleted = 0;
257035
257036
  const functionTotal = functions.length;
257036
257037
  const result = await deployAll(projectData, {
@@ -257949,20 +257950,7 @@ async function deployAction2(ctx, options) {
257949
257950
  return { outroMessage: "Deployment cancelled" };
257950
257951
  }
257951
257952
  }
257952
- if (ctx.app && project2.site?.outputDirectory) {
257953
- const shouldBuild = await shouldBuildBeforeDeploy({
257954
- build: options.build,
257955
- isNonInteractive,
257956
- buildCommand: project2.site.buildCommand
257957
- });
257958
- if (shouldBuild) {
257959
- await runSiteBuild(ctx, {
257960
- root: project2.root,
257961
- buildCommand: project2.site.buildCommand,
257962
- appId: ctx.app.id
257963
- });
257964
- }
257965
- }
257953
+ await maybeBuildBeforeDeploy(ctx, project2, options.build);
257966
257954
  const result = await runTask2("Creating archive and deploying site...", async () => {
257967
257955
  return await deploySite(outputDir);
257968
257956
  }, {
@@ -266766,4 +266754,4 @@ export {
266766
266754
  CLIExitError
266767
266755
  };
266768
266756
 
266769
- //# debugId=1FB40B1345DFA60B64756E2164756E21
266757
+ //# debugId=0EC4691CF34BC30564756E2164756E21