Skip to content

Commit

Permalink
fix: Add absolute path for bin
Browse files Browse the repository at this point in the history
  • Loading branch information
riosje committed Jun 7, 2024
1 parent 15e6500 commit 2c03184
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 58 deletions.
60 changes: 5 additions & 55 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30750,13 +30750,6 @@ try {
} catch (er) {}


/***/ }),

/***/ 6760:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

module.exports = __nccwpck_require__.p + "293248747edf5d37944a.js?.";

/***/ }),

/***/ 9491:
Expand Down Expand Up @@ -32608,50 +32601,11 @@ module.exports = parseParams
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __nccwpck_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (typeof import.meta.url === "string") scriptUrl = import.meta.url
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __nccwpck_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
/******/
/******/ /* webpack/runtime/import chunk loading */
/******/ (() => {
/******/ __nccwpck_require__.b = new URL("./", import.meta.url);
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ 179: 0
/******/ };
/******/
/******/ // no install chunk
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no external install chunk
/******/
/******/ // no on chunks loaded
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
Expand All @@ -32661,10 +32615,8 @@ var __webpack_exports__ = {};
const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
var core = __nccwpck_require__(2186);
;// CONCATENATED MODULE: external "node:path"
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
;// CONCATENATED MODULE: external "node:url"
const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url");
// EXTERNAL MODULE: external "path"
var external_path_ = __nccwpck_require__(1017);
// EXTERNAL MODULE: ./node_modules/@actions/tool-cache/lib/tool-cache.js
var tool_cache = __nccwpck_require__(7784);
// EXTERNAL MODULE: ./node_modules/undici/index.js
Expand Down Expand Up @@ -32762,19 +32714,17 @@ var exec = __nccwpck_require__(1514);




async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) {
const metadata = await getNsolidVersion({
nodeVersion,
nsolidVersion,
platform,
arch,
});
const __dirname = new URL(/* asset import */ __nccwpck_require__(6760), __nccwpck_require__.b).pathname;

let toolPath = await downloadNsolid(metadata);
if (metadata.platform === "win32") {
toolPath = external_node_path_namespaceObject.join(core.toWin32Path(`${toolPath}/`));
toolPath = external_path_.join(core.toWin32Path(`${toolPath}/`));
core.addPath(toolPath);
// Delete Current nodejs bin
try {
Expand All @@ -32797,7 +32747,7 @@ async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }) {
return;
}

toolPath = external_node_path_namespaceObject.join(toolPath, "bin");
toolPath = external_path_.join(toolPath, "bin");
core.info(`Adding ${toolPath} to PATH`);
core.addPath(toolPath);
return;
Expand All @@ -32816,7 +32766,7 @@ async function downloadNsolid(metadata) {
"--strip",
"4",
]);
return `${downloadPath}/${toolPath}`;
return toolPath;
}
downloadPath = await tool_cache.downloadTool(metadata.url);
const toolPath = await tool_cache.extractTar(downloadPath, `${extractPath}/${fileName}`, ["xz", "--strip", "1"]);
Expand Down
4 changes: 1 addition & 3 deletions src/lib/install.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as path from "node:path";
import { URL } from 'node:url'
import * as path from "path";
import core from "@actions/core";
import * as tc from "@actions/tool-cache";
import { getNsolidVersion } from "./metadata.js";
Expand All @@ -12,7 +11,6 @@ export async function setupNsolid({ nodeVersion, nsolidVersion, platform, arch }
platform,
arch,
});
const __dirname = new URL('.', import.meta.url).pathname;

let toolPath = await downloadNsolid(metadata);
if (metadata.platform === "win32") {
Expand Down

0 comments on commit 2c03184

Please sign in to comment.