mirror of https://github.com/aminya/setup-cpp
fix: use /Users/ instead of /home/ on MacOS
This commit is contained in:
parent
fcfb09bb91
commit
861fbd37a1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,11 @@ import { isRoot } from "../env/sudo"
|
|||
export function untildify_user(path: string) {
|
||||
if (isRoot() && typeof process.env.SUDO_USER === "string") {
|
||||
// use the user profile even if root
|
||||
return join("/home/", process.env.SUDO_USER, path)
|
||||
if (process.platform === "darwin") {
|
||||
return join("/Users/", process.env.SUDO_USER, path)
|
||||
} else {
|
||||
return join("/home/", process.env.SUDO_USER, path)
|
||||
}
|
||||
} else {
|
||||
return untildify(`~/${path}`)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue