mirror of https://github.com/aminya/setup-cpp
fix: untildify the profile path
This commit is contained in:
parent
c0e8c96665
commit
f13a48fae9
|
@ -20,6 +20,7 @@
|
||||||
"nothrow",
|
"nothrow",
|
||||||
"Opencppcoverage",
|
"Opencppcoverage",
|
||||||
"OSSDK",
|
"OSSDK",
|
||||||
|
"setx",
|
||||||
"untildify",
|
"untildify",
|
||||||
"vcpkg",
|
"vcpkg",
|
||||||
"visualc",
|
"visualc",
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,7 @@ import { delimiter } from "path"
|
||||||
import * as core from "@actions/core"
|
import * as core from "@actions/core"
|
||||||
import execa from "execa"
|
import execa from "execa"
|
||||||
import { isGitHubCI } from "../env/isci"
|
import { isGitHubCI } from "../env/isci"
|
||||||
|
import untildify from "untildify"
|
||||||
|
|
||||||
/** An add path function that works locally or inside GitHub Actions */
|
/** An add path function that works locally or inside GitHub Actions */
|
||||||
export function addPath(path: string) {
|
export function addPath(path: string) {
|
||||||
|
@ -31,9 +32,10 @@ function addPathSystem(path: string) {
|
||||||
}
|
}
|
||||||
case "linux":
|
case "linux":
|
||||||
case "darwin": {
|
case "darwin": {
|
||||||
execa.commandSync(`echo "export PATH=${path}:$PATH" >> ~/.profile`)
|
const profile_path = untildify("~/.profile")
|
||||||
execa.commandSync(`source ~/.profile`)
|
execa.commandSync(`echo "export PATH=${path}:$PATH" >> "${profile_path}"`)
|
||||||
core.info(`${path} was added to ~/.profile`)
|
execa.commandSync(`source "${profile_path}"`)
|
||||||
|
core.info(`${path} was added to "${profile_path}"`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
Loading…
Reference in New Issue