Skip to content

Commit

Permalink
define path
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jun 13, 2024
1 parent 2542a7d commit 9087dee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 6 additions & 3 deletions action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33093,6 +33093,7 @@ const tc = __importStar(__nccwpck_require__(7784));
const github = __importStar(__nccwpck_require__(5438));
const process = __importStar(__nccwpck_require__(7282));
const fs = __importStar(__nccwpck_require__(7147));
const path = __importStar(__nccwpck_require__(1017));
function getExecutableName() {
let platform;
switch (process.platform) {
Expand Down Expand Up @@ -33149,20 +33150,22 @@ function setup() {
if (!asset) {
throw new Error(`No asset found for ${executableName}`);
}
const destination = path.join(__dirname, 'network-hub');
core.info(`Downloading network-hub from ${asset.url}`);
const binPath = yield tc.downloadTool(asset.url, undefined, `token ${token}`, {
const binPath = yield tc.downloadTool(asset.url, destination, `token ${token}`, {
accept: 'application/octet-stream'
});
// list the files in the binPath
fs.readdirSync(binPath).forEach(file => {
fs.readdirSync(__dirname).forEach(file => {
core.info(file);
});
core.info(`Successfully downloaded network-hub to ${binPath}`);
fs.chmodSync(binPath, '755');
//
// let extractArgs = core.getMultilineInput("extractArgs");
// let extractedPath = await tc.extractTar(binPath, undefined, extractArgs);
// core.info(`Successfully extracted network-hub to ${extractedPath}`)
core.addPath(binPath);
core.addPath(destination);
});
}
setup().catch((error) => {
Expand Down
11 changes: 8 additions & 3 deletions action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as tc from '@actions/tool-cache';
import * as github from '@actions/github';
import * as process from 'process';
import * as fs from 'fs';
import * as path from 'path';

function getExecutableName(): string {
let platform: string
Expand Down Expand Up @@ -72,26 +73,30 @@ async function setup() {
throw new Error(`No asset found for ${executableName}`)
}

const destination = path.join(__dirname, 'network-hub')

core.info(`Downloading network-hub from ${asset.url}`)
const binPath = await tc.downloadTool(asset.url,
undefined,
destination,
`token ${token}`,
{
accept: 'application/octet-stream'
}
);

// list the files in the binPath
fs.readdirSync(binPath).forEach(file => {
fs.readdirSync(__dirname).forEach(file => {
core.info(file);
});

core.info(`Successfully downloaded network-hub to ${binPath}`)

fs.chmodSync(binPath, '755');
//
// let extractArgs = core.getMultilineInput("extractArgs");
// let extractedPath = await tc.extractTar(binPath, undefined, extractArgs);
// core.info(`Successfully extracted network-hub to ${extractedPath}`)
core.addPath(binPath);
core.addPath(destination);
}

setup().catch((error) => {
Expand Down

0 comments on commit 9087dee

Please sign in to comment.