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 29d0a0f commit 0cae5e4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32705,12 +32705,15 @@ async function getMetadata({ nodeVersion, nsolidVersion, platform, arch }) {
}
}

// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js
var exec = __nccwpck_require__(1514);
;// CONCATENATED MODULE: ./src/lib/install.js






async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) {
const metadata = await getNsolidVersion({
nodeVersion,
Expand All @@ -32721,13 +32724,17 @@ async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) {
let toolPath = await downloadNsolid(metadata);
if (metadata.platform !== "win32") {
toolPath = external_path_.join(toolPath, "bin");
core.addPath(toolPath);
return
}

if (metadata.platform === "win32") {
toolPath = external_path_.join(core.toWin32Path(toolPath));
core.addPath(toolPath);
await exec.exec('Set-Alias -Name node -Value nsolid');
return
}
core.addPath(toolPath);
return;

}

async function downloadNsolid(metadata) {
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.2.0",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
Expand Down
9 changes: 7 additions & 2 deletions src/lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as path from "path";
import core from "@actions/core";
import * as tc from "@actions/tool-cache";
import { getNsolidVersion } from "./metadata.js";
import * as exec from '@actions/exec';

export async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) {
const metadata = await getNsolidVersion({
Expand All @@ -13,13 +14,17 @@ export async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }
let toolPath = await downloadNsolid(metadata);
if (metadata.platform !== "win32") {
toolPath = path.join(toolPath, "bin");
core.addPath(toolPath);
return
}

if (metadata.platform === "win32") {
toolPath = path.join(core.toWin32Path(toolPath));
core.addPath(toolPath);
await exec.exec('Set-Alias -Name node -Value nsolid');
return
}
core.addPath(toolPath);
return;

}

async function downloadNsolid(metadata) {
Expand Down

0 comments on commit 0cae5e4

Please sign in to comment.