Skip to content

Commit 2b9e5df

Browse files
committed
Support subdirectory for install action
1 parent 6278efe commit 2b9e5df

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

install/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ runs:
66
main: main.js
77
inputs:
88
tool_versions:
9-
description:
9+
description: |-
1010
If present, this value will be written to the .tool-versions file.
1111
required: false
1212
before_install:
13-
description:
13+
description: |-
1414
Bash script to run after plugins are installed but before `asdf install`.
1515
eg, to install npm keyring
1616
required: false

install/main.js

+5
Original file line numberDiff line numberDiff line change
@@ -3261,6 +3261,7 @@ var require_exec = __commonJS({
32613261
var core4 = __toESM(require_core());
32623262

32633263
// src/install/index.ts
3264+
var import_node_process = require("node:process");
32643265
var core3 = __toESM(require_core());
32653266
var exec5 = __toESM(require_exec());
32663267

@@ -3363,6 +3364,10 @@ async function pluginsAdd() {
33633364

33643365
// src/install/index.ts
33653366
async function toolsInstall() {
3367+
const dir = core3.getInput("directory", { required: false });
3368+
if (dir) {
3369+
(0, import_node_process.chdir)(dir);
3370+
}
33663371
await pluginsAdd();
33673372
const before = core3.getInput("before_install", { required: false });
33683373
if (before) {

src/install/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import {chdir} from 'node:process';
12
import * as core from '@actions/core';
23
import * as exec from '@actions/exec';
34
import {pluginsAdd} from '~/plugins-add/index.ts';
45

56
async function toolsInstall(): Promise<void> {
7+
const dir = core.getInput('directory', {required: false});
8+
if (dir) {
9+
chdir(dir);
10+
}
11+
612
await pluginsAdd();
713

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

0 commit comments

Comments
 (0)