mirror of https://github.com/aminya/setup-cpp
chore: remove unused updateAptAlternatives for pacman
This commit is contained in:
parent
7caf0ddff8
commit
e799c954a4
|
@ -1,10 +1,7 @@
|
||||||
/* eslint-disable require-atomic-updates */
|
/* eslint-disable require-atomic-updates */
|
||||||
import { InstallationInfo } from "./setupBin"
|
import { InstallationInfo } from "./setupBin"
|
||||||
import { execSudo } from "../exec/sudo"
|
import { execSudo } from "../exec/sudo"
|
||||||
import { info } from "@actions/core"
|
import { info } from "../io/io"
|
||||||
import { isGitHubCI } from "../env/isci"
|
|
||||||
import { cpprc_path, setupCppInProfile } from "../env/addEnv"
|
|
||||||
import { appendFileSync } from "fs"
|
|
||||||
|
|
||||||
let didUpdate: boolean = false
|
let didUpdate: boolean = false
|
||||||
let didInit: boolean = false
|
let didInit: boolean = false
|
||||||
|
@ -21,10 +18,11 @@ export function setupPacmanPack(name: string, version?: string, aur?: string): I
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!didInit) {
|
if (!didInit) {
|
||||||
// install base-devel
|
|
||||||
// set time - zone
|
// set time - zone
|
||||||
// TZ = Canada / Pacific
|
// TZ = Canada / Pacific
|
||||||
// ln - snf / usr / share / zoneinfo / $TZ / etc / localtime && echo $TZ > /etc/timezone
|
// ln - snf / usr / share / zoneinfo / $TZ / etc / localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
// install base-devel
|
||||||
execSudo(pacman, ["-Sy", "--noconfirm", "base-devel"])
|
execSudo(pacman, ["-Sy", "--noconfirm", "base-devel"])
|
||||||
didInit = true
|
didInit = true
|
||||||
}
|
}
|
||||||
|
@ -41,15 +39,3 @@ export function setupPacmanPack(name: string, version?: string, aur?: string): I
|
||||||
|
|
||||||
return { binDir: "/usr/bin/" }
|
return { binDir: "/usr/bin/" }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateAptAlternatives(name: string, path: string) {
|
|
||||||
if (isGitHubCI()) {
|
|
||||||
return execSudo("update-alternatives", ["--install", `/usr/bin/${name}`, name, path, "40"])
|
|
||||||
} else {
|
|
||||||
setupCppInProfile()
|
|
||||||
return appendFileSync(
|
|
||||||
cpprc_path,
|
|
||||||
`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} 40; fi\n`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue