File tree Expand file tree Collapse file tree 8 files changed +25
-7
lines changed Expand file tree Collapse file tree 8 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 1
- import { addPath } from "@actions/core "
1
+ import { addPath } from "../utils/path/addPath "
2
2
import { setupAptPack } from "../utils/setup/setupAptPack"
3
3
import { setupBrewPack } from "../utils/setup/setupBrewPack"
4
4
import { setupChocoPack } from "../utils/setup/setupChocoPack"
Original file line number Diff line number Diff line change 1
- import { addPath } from "@actions/core "
1
+ import { addPath } from "../utils/path/addPath "
2
2
import { setupAptPack } from "../utils/setup/setupAptPack"
3
3
import { setupBrewPack } from "../utils/setup/setupBrewPack"
4
4
import { setupChocoPack } from "../utils/setup/setupChocoPack"
Original file line number Diff line number Diff line change 1
- import { addPath , exportVariable , info } from "@actions/core"
1
+ import { exportVariable , info } from "@actions/core"
2
+ import { addPath } from "../utils/path/addPath"
2
3
import { existsSync } from "fs"
3
4
import { setupAptPack } from "../utils/setup/setupAptPack"
4
5
import { setupBrewPack } from "../utils/setup/setupBrewPack"
Original file line number Diff line number Diff line change 1
- import { addPath } from "@actions/core "
1
+ import { addPath } from "../utils/path/addPath "
2
2
import { setupChocoPack } from "../utils/setup/setupChocoPack"
3
3
4
4
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Original file line number Diff line number Diff line change
1
+ import { addPath as ghAddPath } from "@actions/core"
2
+ import { delimiter } from "path"
3
+ import * as core from "@actions/core"
4
+
5
+ /** An add path function that works locally or inside GitHub Actions */
6
+ export function addPath ( path : string ) {
7
+ try {
8
+ ghAddPath ( path )
9
+ } catch ( err ) {
10
+ core . error ( err as Error )
11
+ core . error ( `Failed to add ${ path } to the percistent PATH. You should add it manually.` )
12
+ process . env . PATH = `${ path } ${ delimiter } ${ process . env . PATH } `
13
+ // TODO shell out to add path
14
+ }
15
+ }
Original file line number Diff line number Diff line change 1
1
import { find , downloadTool , cacheDir } from "@actions/tool-cache"
2
- import { addPath , info } from "@actions/core"
2
+ import { info } from "@actions/core"
3
+ import { addPath } from "../path/addPath"
3
4
import { join } from "path"
4
5
import { existsSync } from "fs"
5
6
import * as hasha from "hasha"
Original file line number Diff line number Diff line change 1
1
/* eslint-disable require-atomic-updates */
2
- import { addPath } from "@actions/core "
2
+ import { addPath } from "../path/addPath "
3
3
import which from "which"
4
4
import { setupChocolatey } from "../../chocolatey/chocolatey"
5
5
import { InstallationInfo } from "./setupBin"
Original file line number Diff line number Diff line change 2
2
import { getExecOutput } from "@actions/exec"
3
3
import spawn from "cross-spawn"
4
4
import which from "which"
5
- import { addPath , info } from "@actions/core"
5
+ import { info } from "@actions/core"
6
+ import { addPath } from "../path/addPath"
6
7
import { setupPython } from "../../python/python"
7
8
import { isBinUptoDate } from "./version"
8
9
import { join } from "path"
You can’t perform that action at this time.
0 commit comments