Skip to content

Commit cdf729c

Browse files
author
Robert Jackson
authored
Merge pull request #110 from jeevcat/master
2 parents 3e1b128 + 7fe1734 commit cdf729c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/installer.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as core from '@actions/core';
2+
import { exec, ExecOptions } from '@actions/exec';
23
import * as hc from '@actions/http-client';
3-
import * as tc from '@actions/tool-cache';
44
import * as io from '@actions/io';
5-
import { exec, ExecOptions } from '@actions/exec';
5+
import * as tc from '@actions/tool-cache';
6+
import * as fs from 'fs';
67
import type { OutgoingHttpHeaders } from 'http';
78
import * as os from 'os';
89
import * as path from 'path';
910
import * as semver from 'semver';
10-
import * as fs from 'fs';
1111
import { v4 as uuidV4 } from 'uuid';
1212

1313
type VoltaInstallOptions = {
@@ -242,7 +242,8 @@ async function acquireVolta(version: string, options: VoltaInstallOptions): Prom
242242

243243
async function setupVolta(version: string, voltaHome: string): Promise<void> {
244244
if (voltaVersionHasSetup(version)) {
245-
await exec(path.join(voltaHome, 'bin', 'volta'), ['setup'], {
245+
const executable = path.join(voltaHome, 'bin', 'volta');
246+
await exec(executable, ['setup'], {
246247
env: {
247248
// VOLTA_HOME needs to be set before calling volta setup
248249
VOLTA_HOME: voltaHome,
@@ -331,12 +332,12 @@ export async function getVolta(options: VoltaInstallOptions): Promise<void> {
331332
// download, extract, cache
332333
const toolRoot = await acquireVolta(version, options);
333334

334-
await setupVolta(version, toolRoot);
335-
336335
// Install into the local tool cache - node extracts with a root folder
337336
// that matches the fileName downloaded
338337
voltaHome = await tc.cacheDir(toolRoot, 'volta', version);
339338

339+
await setupVolta(version, voltaHome);
340+
340341
core.info(`caching volta@${version} into ${voltaHome}`);
341342
} else {
342343
core.info(`using cached volta@${version}`);

0 commit comments

Comments
 (0)