Skip to content

Commit

Permalink
chore: First implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Jefferson <[email protected]>
  • Loading branch information
riosje committed Feb 26, 2024
1 parent 7b7d008 commit 5d685c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
23 changes: 6 additions & 17 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32673,22 +32673,6 @@ function getSemverMaxSatisfying(versions, range) {
return max_satisfying(versions, range);
}

function getSemverValid(version) {
return semverValid(version);
}

// This validate the version of Nsolid which can be a SEMVER version or a string "latest".
function validateNsolidVersion(version) {
return /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$|^latest$/.test(
version,
);
}

// This action use as input only the major version of Node.js, so we need to validate the version. eg: 18, 20
function validateNodeVersion(version) {
return /^(\d+)\.(\d+)\.(\d+)$/.test(version);
}

;// CONCATENATED MODULE: ./src/lib/metadata.js


Expand Down Expand Up @@ -32774,9 +32758,14 @@ async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) {
arch,
});
let toolPath = await downloadNsolid(metadata);
if (metadata.platform !== "win32") {
if (core.platform.isWindows) {
toolPath = external_path_.join(core.toWin32Path(toolPath));
}
if (!core.platform.isWindows) {
toolPath = external_path_.join(toolPath, "bin");
}
core.info(`N|Solid has been added to the path at ${toolPath}`);

core.addPath(toolPath);
return;
}
Expand Down
7 changes: 6 additions & 1 deletion src/lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ export async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }
arch,
});
let toolPath = await downloadNsolid(metadata);
if (metadata.platform !== "win32") {
if (core.platform.isWindows) {
toolPath = path.join(core.toWin32Path(toolPath));
}
if (!core.platform.isWindows) {
toolPath = path.join(toolPath, "bin");
}
core.info(`N|Solid has been added to the path at ${toolPath}`);

core.addPath(toolPath);
return;
}
Expand Down

0 comments on commit 5d685c7

Please sign in to comment.