Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Jan 16, 2025
1 parent ae30113 commit bdf8a44
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,15 @@ class GenHIE {
path;
stack;
exists;
installed;
constructor(stack, path) {
this.stack = stack;
this.path = path ? path : exports.HIE_YAML;
this.exists = fs.existsSync(this.path);
this.installed = false;
}
async install() {
if (this.exists) {
try {
await this.stack.installCompilerTools(["implicit-hie"]);
this.installed = true;
}
catch {
core.warning(`Failed to install implicit-hie, ${this.path} will not be maintained`);
Expand All @@ -275,7 +272,8 @@ class GenHIE {
core.info(`Skipping, ${this.path} does not exist`);
return;
}
if (!this.installed) {
const installed = await this.stack.which("gen-hie");
if (!installed) {
core.info(`Skipping, implicit-hie was not successfully installed`);
return;
}
Expand Down Expand Up @@ -751,6 +749,12 @@ class StackCLI {
async query() {
return await this.parse(["query"], parse_stack_query_1.parseStackQuery);
}
async which(cmd) {
const ec = await this.exec(["exec", "--", "which", cmd], {
ignoreReturnCode: true,
});
return ec === 0;
}
async parse(args, f) {
const stdout = await this.read(args);
return f(stdout);
Expand Down

0 comments on commit bdf8a44

Please sign in to comment.