Skip to content

Commit

Permalink
Support subdirectory for install action
Browse files Browse the repository at this point in the history
  • Loading branch information
afirth committed Jul 23, 2024
1 parent 6278efe commit 2b9e5df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ runs:
main: main.js
inputs:
tool_versions:
description:
description: |-
If present, this value will be written to the .tool-versions file.
required: false
before_install:
description:
description: |-
Bash script to run after plugins are installed but before `asdf install`.
eg, to install npm keyring
required: false
Expand Down
5 changes: 5 additions & 0 deletions install/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3261,6 +3261,7 @@ var require_exec = __commonJS({
var core4 = __toESM(require_core());

// src/install/index.ts
var import_node_process = require("node:process");
var core3 = __toESM(require_core());
var exec5 = __toESM(require_exec());

Expand Down Expand Up @@ -3363,6 +3364,10 @@ async function pluginsAdd() {

// src/install/index.ts
async function toolsInstall() {
const dir = core3.getInput("directory", { required: false });
if (dir) {
(0, import_node_process.chdir)(dir);
}
await pluginsAdd();
const before = core3.getInput("before_install", { required: false });
if (before) {
Expand Down
6 changes: 6 additions & 0 deletions src/install/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import {chdir} from 'node:process';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import {pluginsAdd} from '~/plugins-add/index.ts';

async function toolsInstall(): Promise<void> {
const dir = core.getInput('directory', {required: false});
if (dir) {
chdir(dir);
}

await pluginsAdd();

const before = core.getInput('before_install', {required: false});
Expand Down

0 comments on commit 2b9e5df

Please sign in to comment.