Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPechaCZ committed Nov 21, 2024
1 parent 57bcd36 commit a903418
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/commands/sites/utils/prepareGitHubActionsIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ export const prepareGitHubActionsIntegration = async ({
fleekConfigPath,
output,
}: PrepareGitHubActionsIntegrationArgs) => {
let nodeSemver = process.version;
let nodeVersion;

if (!nodeSemver) {
try {
nodeSemver = loadJSONFromPackageRoot('package.json').engines.node.replace(
/[^0-9\.]+/,
'',
);
} catch {}
try {
const nodeSemver = loadJSONFromPackageRoot(
'package.json',
).engines.node.replace(/[^0-9\.]+/, '');

nodeVersion = parseSemver(nodeSemver)?.major ?? 18;
} catch {
nodeVersion = 18;
}

const installCommand = await requestDeploymentWorkflowInstallCommand();
const yamlContent = generateDeploymentWorkflowYaml({
nodeVersion: parseSemver(nodeSemver)?.major ?? 18,
nodeVersion,
fleekConfigPath,
installCommand,
});
Expand Down

0 comments on commit a903418

Please sign in to comment.