mirror of https://github.com/aminya/setup-cpp.git
fix: do not install git if already installed
This commit is contained in:
parent
873a0ce059
commit
15b21af353
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,9 @@
|
|||
import { existsSync } from "fs"
|
||||
import { warning } from "ci-log"
|
||||
import { info, warning } from "ci-log"
|
||||
import { addPath } from "envosman"
|
||||
import { installAptPack } from "setup-apt"
|
||||
import { installBrewPack } from "setup-brew"
|
||||
import which from "which"
|
||||
import { rcOptions } from "../cli-options.js"
|
||||
import { hasDnf } from "../utils/env/hasDnf.js"
|
||||
import { isArch } from "../utils/env/isArch.js"
|
||||
|
|
@ -13,6 +14,12 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
|
|||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export async function setupGit(version: string, _setupDir: string, _arch: string) {
|
||||
const git = await which("git", { nothrow: true })
|
||||
if (git !== null) {
|
||||
info(`Git already installed at ${git}`)
|
||||
return
|
||||
}
|
||||
|
||||
switch (process.platform) {
|
||||
case "win32": {
|
||||
const result = await setupChocoPack("git", version)
|
||||
|
|
|
|||
Loading…
Reference in New Issue