Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Apr 27, 2024
1 parent 78dbb25 commit c135c3d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 39 deletions.
33 changes: 14 additions & 19 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function setup() {
const version = core.getInput('version');

// Download the specific version of the tool, e.g. as a tarball/zipball
const download = getDownloadObject(version);
const download = await getDownloadObject(version);
const pathToTarball = await tc.downloadTool(download.url);

// Extract the tarball/zipball onto host runner
Expand Down Expand Up @@ -46,30 +46,25 @@ if (require.main === require.cache[eval('__filename')]) {

const getos = __nccwpck_require__(6068);

function getImage() {
let image = 'aaa';

getos(function (e, os) {
//if (e) {
// throw new Error(e);
//}

console.log(os);
console.log(image);
if (os.os === 'linux') {
async function getImage() {
return new Promise((resolve, reject) => {
getos(function (e, os) {
if (e) {
reject(e);
}
let image = 'aaa';
if (os.os === 'linux') {
if (os.dist === 'Ubuntu') {
image = `ubuntu-${ os.release }`;
}
}
return console.log(image);
}
resolve(image);
});
});

console.log(image);
return image;
}

function getDownloadObject(version) {
const image = getImage();
async function getDownloadObject(version) {
const image = await getImage();
console.log(image);
const filename = `verilator-${ image }`;
const binPath = 'bin';
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function setup() {
const version = core.getInput('version');

// Download the specific version of the tool, e.g. as a tarball/zipball
const download = getDownloadObject(version);
const download = await getDownloadObject(version);
const pathToTarball = await tc.downloadTool(download.url);

// Extract the tarball/zipball onto host runner
Expand Down
31 changes: 13 additions & 18 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
const getos = require('getos');

function getImage() {
let image = 'aaa';

getos(function (e, os) {
//if (e) {
// throw new Error(e);
//}

console.log(os);
console.log(image);
if (os.os === 'linux') {
async function getImage() {
return new Promise((resolve, reject) => {
getos(function (e, os) {
if (e) {
reject(e);
}
let image = 'aaa';
if (os.os === 'linux') {
if (os.dist === 'Ubuntu') {
image = `ubuntu-${ os.release }`;
}
}
return console.log(image);
}
resolve(image);
});
});

console.log(image);
return image;
}

function getDownloadObject(version) {
const image = getImage();
async function getDownloadObject(version) {
const image = await getImage();
console.log(image);
const filename = `verilator-${ image }`;
const binPath = 'bin';
Expand Down

0 comments on commit c135c3d

Please sign in to comment.