feat: add os-env package for managing path, env, rc files

This commit is contained in:
Amin Yahyaabadi 2024-08-14 18:22:33 -07:00
parent 5962369655
commit 77e643057d
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
42 changed files with 622 additions and 510 deletions

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -74,6 +74,7 @@
"admina": "^1.0.1", "admina": "^1.0.1",
"caxa": "^3.0.1", "caxa": "^3.0.1",
"ci-info": "^4.0.0", "ci-info": "^4.0.0",
"os-env": "workspace:*",
"ci-log": "workspace:*", "ci-log": "workspace:*",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
@ -128,6 +129,7 @@
"admina", "admina",
"ci-info", "ci-info",
"ci-log", "ci-log",
"os-env",
"escape-path-with-spaces", "escape-path-with-spaces",
"escape-quotes", "escape-quotes",
"escape-string-regexp", "escape-string-regexp",

View File

@ -0,0 +1,42 @@
{
"name": "os-env",
"version": "1.0.0",
"description": "Manage environment variables, PATH, and rc files",
"homepage": "https://github.com/aminya/setup-cpp",
"license": "Apache-2.0",
"author": "Amin Yahyaabadi",
"main": "./dist/index.js",
"source": "./src/index.ts",
"scripts": {
"build": "tsc"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@types/node": "^12",
"admina": "^1.0.1",
"ci-info": "^4.0.0",
"escape-path-with-spaces": "^1.0.2",
"escape-quotes": "^1.0.2",
"micro-memoize": "^4.1.2",
"path-exists": "^5.0.0",
"ci-log": "workspace:*",
"exec-powershell": "workspace:*",
"untildify-user": "workspace:*"
},
"engines": {
"node": ">=12"
},
"keywords": [
"env",
"path",
"dotenv",
"rc",
"addEnv",
"addPath",
"setEnv",
"linux",
"windows",
"unix",
"macos"
]
}

View File

@ -0,0 +1,94 @@
import { promises } from "fs"
import { exportVariable as ghExportVariable } from "@actions/core"
import { GITHUB_ACTIONS } from "ci-info"
import { error, info } from "ci-log"
import { execPowershell } from "exec-powershell"
import { untildifyUser } from "untildify-user"
import { sourceRC } from "./rc-file.js"
import { escapeString } from "./utils.js"
const { appendFile } = promises
export type AddEnvOptions = {
/** If true, the value will be escaped with quotes and spaces will be escaped with backslash */
shouldEscapeSpace: boolean
/** If true, the variable will be only added if it is not defined */
shouldAddOnlyIfNotDefined: boolean
/**
* The path to the RC file that the env variables should be added to.
*/
rcPath: string
}
/**
* Add an environment variable.
*
* This function is cross-platforms and works in all the local or CI systems.
*/
export async function addEnv(
name: string,
valGiven: string | undefined,
givenOptions: Partial<AddEnvOptions> = {},
) {
const options = {
shouldEscapeSpace: false,
shouldAddOnlyIfNotDefined: false,
rcPath: untildifyUser(".bashrc"),
...givenOptions,
}
const val = escapeString(valGiven ?? "", options.shouldEscapeSpace)
try {
if (GITHUB_ACTIONS) {
try {
if (options.shouldAddOnlyIfNotDefined) {
if (process.env[name] !== undefined) {
info(`Environment variable ${name} is already defined. Skipping.`)
return
}
}
ghExportVariable(name, val)
} catch (err) {
error(err as Error)
await addEnvSystem(name, val, options)
}
} else {
await addEnvSystem(name, val, options)
}
} catch (err) {
error(`${err}\nFailed to export environment variable ${name}=${val}. You should add it manually.`)
}
}
async function addEnvSystem(name: string, valGiven: string | undefined, options: AddEnvOptions) {
const val = valGiven ?? ""
switch (process.platform) {
case "win32": {
if (options.shouldAddOnlyIfNotDefined) {
if (process.env[name] !== undefined) {
info(`Environment variable ${name} is already defined. Skipping.`)
return
}
}
// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit
await execPowershell(`[Environment]::SetEnvironmentVariable('${name}', '${val}', "User")`)
info(`${name}='${val}' was set in the environment.`)
return
}
case "linux":
case "darwin": {
await sourceRC(options.rcPath)
if (options.shouldAddOnlyIfNotDefined) {
await appendFile(options.rcPath, `\nif [ -z "\${${name}}" ]; then export ${name}="${val}"; fi\n`)
info(`if not defined ${name} then ${name}="${val}" was added to "${options.rcPath}`)
} else {
await appendFile(options.rcPath, `\nexport ${name}="${val}"\n`)
info(`${name}="${val}" was added to "${options.rcPath}`)
}
return
}
default: {
// fall through shell path modification
}
}
process.env[name] = val
}

View File

@ -0,0 +1,79 @@
import { promises } from "fs"
import { delimiter } from "path"
import { addPath as ghAddPath } from "@actions/core"
import { GITHUB_ACTIONS } from "ci-info"
import { error, info } from "ci-log"
import { execPowershell } from "exec-powershell"
import { untildifyUser } from "untildify-user"
import { sourceRC } from "./rc-file.js"
const { appendFile } = promises
type AddPathOptions = {
/**
* The path to the RC file that the PATH variables should be added to.
*/
rcPath: string
}
/**
* Add a path to the PATH environment variable.
*
* This function is cross-platforms and works in all the local or CI systems.
*/
export async function addPath(path: string, givenOptions: Partial<AddPathOptions> = {}) {
const options = { rcPath: untildifyUser(".bashrc"), ...givenOptions }
if (isIgnoredPath(path)) {
return
}
process.env.PATH = `${path}${delimiter}${process.env.PATH}`
try {
if (GITHUB_ACTIONS) {
try {
ghAddPath(path)
} catch (err) {
error(err as Error)
await addPathSystem(path, options.rcPath)
}
} else {
await addPathSystem(path, options.rcPath)
}
} catch (err) {
error(`${err}\nFailed to add ${path} to the percistent PATH. You should add it manually.`)
}
}
async function addPathSystem(path: string, rcPath: string) {
switch (process.platform) {
case "win32": {
// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit and also because %PATH% is different for user and system
await execPowershell(
`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${path};$USER_PATH", "User")`,
)
info(`"${path}" was added to the PATH.`)
return
}
case "linux":
case "darwin": {
await sourceRC(rcPath)
await appendFile(rcPath, `\nexport PATH="${path}:$PATH"\n`)
info(`"${path}" was added to "${rcPath}"`)
return
}
default: {
return
}
}
}
const ignoredPaths = [/\/usr\/bin\/?/, /\/usr\/local\/bin\/?/]
/** Skip adding /usr/bin to PATH if it is already there */
function isIgnoredPath(path: string) {
if (ignoredPaths.some((checkedPath) => checkedPath.test(path))) {
const paths = process.env.PATH?.split(delimiter) ?? []
return paths.includes(path)
}
return false
}

17
packages/os-env/src/escape-quotes.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
declare module "escape-quotes" {
/**
* Escape `'` with `\\`
* @param input the input string
*/
declare function escapeQuote(input: string): string
/**
* Escape the given character with the given escape character
* @param input the input string
* @param character the character to escape (e.g. `'`)
* @param escape_character the character to escape with (e.g. `\\`)
*/
declare function escapeQuote(input: string, character: string, escape_character: string): string
export = escapeQuote
}

View File

@ -0,0 +1,3 @@
export { addEnv } from "./add-env.js"
export { addPath } from "./add-path.js"
export { finalizeRC, sourceRC } from "./rc-file.js"

View File

@ -0,0 +1,75 @@
import { promises } from "fs"
import { grantUserWriteAccess } from "admina"
import { info, warning } from "ci-log"
import memoize from "micro-memoize"
import { pathExists } from "path-exists"
import { untildifyUser } from "untildify-user"
const { appendFile, readFile, writeFile } = promises
async function sourceRC_raw(rcPath: string) {
const sourceRcString =
`\n# source .cpprc if SOURCE_CPPRC is not set to 0\nif [[ "$SOURCE_CPPRC" != 0 && -f "${rcPath}" ]]; then source "${rcPath}"; fi\n`
try {
await Promise.all([
addRCHeader(rcPath),
sourceRcInProfile(sourceRcString),
sourceRCInBashrc(sourceRcString),
])
} catch (err) {
warning(`Failed to add ${sourceRcString} to .profile or .bashrc. You should add it manually: ${err}`)
}
}
/**
* handles adding conditions to source rc file from .bashrc and .profile
*/
export const sourceRC = memoize(sourceRC_raw, { isPromise: true })
async function addRCHeader(rcPath: string) {
// a variable that prevents source_cpprc from being called from .bashrc and .profile
const rcHeader = "# Automatically Generated by os-env\nexport SOURCE_CPPRC=0"
if (await pathExists(rcPath)) {
const rcContent = await readFile(rcPath, "utf8")
if (!rcContent.includes(rcHeader)) {
// already executed setupCppInProfile
await appendFile(rcPath, `\n${rcHeader}\n`)
info(`Added ${rcHeader} to ${rcPath}`)
}
}
}
async function sourceRCInBashrc(sourceRcString: string) {
const bashrcPath = untildifyUser("~/.bashrc")
if (await pathExists(bashrcPath)) {
const bashrcContent = await readFile(bashrcPath, "utf-8")
if (!bashrcContent.includes(sourceRcString)) {
await appendFile(bashrcPath, sourceRcString)
info(`${sourceRcString} was added to ${bashrcPath}`)
}
}
}
async function sourceRcInProfile(sourceRcString: string) {
const profilePath = untildifyUser("~/.profile")
if (await pathExists(profilePath)) {
const profileContent = await readFile(profilePath, "utf-8")
if (!profileContent.includes(sourceRcString)) {
await appendFile(profilePath, sourceRcString)
info(`${sourceRcString} was added to ${profilePath}`)
}
}
}
export async function finalizeRC(rcPath: string) {
if (await pathExists(rcPath)) {
const entries = (await readFile(rcPath, "utf-8")).split("\n")
const uniqueEntries = [...new Set(entries.reverse())].reverse() // remove duplicates, keeping the latest entry
await writeFile(rcPath, uniqueEntries.join("\n"))
await grantUserWriteAccess(rcPath)
}
}

View File

@ -0,0 +1,7 @@
import escapeSpace from "escape-path-with-spaces"
import escapeQuote from "escape-quotes"
export function escapeString(valGiven: string, shouldEscapeSpace: boolean = false) {
const spaceEscaped = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
return escapeQuote(spaceEscaped, "\"", "\\")
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["./src"]
}

View File

@ -134,6 +134,9 @@ importers:
numerous: numerous:
specifier: 1.0.3 specifier: 1.0.3
version: 1.0.3 version: 1.0.3
os-env:
specifier: workspace:*
version: link:packages/os-env
p-timeout: p-timeout:
specifier: ^6.1.2 specifier: ^6.1.2
version: 6.1.2 version: 6.1.2
@ -223,6 +226,42 @@ importers:
specifier: ^3.0.0 specifier: ^3.0.0
version: 3.0.3 version: 3.0.3
packages/os-env:
dependencies:
'@actions/core':
specifier: ^1.10.1
version: 1.10.1
'@types/node':
specifier: ^12
version: 12.20.55
admina:
specifier: ^1.0.1
version: 1.0.1
ci-info:
specifier: ^4.0.0
version: 4.0.0
ci-log:
specifier: workspace:*
version: link:../ci-log
escape-path-with-spaces:
specifier: ^1.0.2
version: 1.0.2
escape-quotes:
specifier: ^1.0.2
version: 1.0.2
exec-powershell:
specifier: workspace:*
version: link:../exec-powershell
micro-memoize:
specifier: ^4.1.2
version: 4.1.2
path-exists:
specifier: ^5.0.0
version: 5.0.0
untildify-user:
specifier: workspace:*
version: link:../untildify-user
packages/untildify-user: packages/untildify-user:
dependencies: dependencies:
admina: admina:
@ -6179,73 +6218,69 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5 '@nodelib/fs.scandir': 2.1.5
fastq: 1.17.1 fastq: 1.17.1
'@parcel/bundler-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/bundler-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/graph': 3.2.0 '@parcel/graph': 3.2.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/cache@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/cache@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12) '@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/logger': 2.12.0 '@parcel/logger': 2.12.0
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
lmdb: 2.8.5 lmdb: 2.8.5
transitivePeerDependencies:
- '@swc/helpers'
'@parcel/codeframe@2.12.0': '@parcel/codeframe@2.12.0':
dependencies: dependencies:
chalk: 4.1.2 chalk: 4.1.2
'@parcel/compressor-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/compressor-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/config-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4)': '@parcel/config-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4)':
dependencies: dependencies:
'@parcel/bundler-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/bundler-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/compressor-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/compressor-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/core': 2.12.0(@swc/helpers@0.5.12) '@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/namer-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/namer-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/optimizer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-htmlnano': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4) '@parcel/optimizer-htmlnano': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(postcss@8.4.41)(typescript@5.5.4)
'@parcel/optimizer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/optimizer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-svgo': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/optimizer-svgo': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/optimizer-swc': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/optimizer-swc': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/packager-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/packager-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/packager-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/packager-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/packager-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/packager-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/packager-wasm': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/packager-wasm': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/resolver-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/resolver-default': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-browser-hmr': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/runtime-browser-hmr': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/runtime-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-react-refresh': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/runtime-react-refresh': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/runtime-service-worker': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/runtime-service-worker': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-babel': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-babel': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-css': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-html': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-image': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12)) '@parcel/transformer-js': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-json': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-json': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-postcss': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-postcss': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-posthtml': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-posthtml': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-raw': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-react-refresh-wrap': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-react-refresh-wrap': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/transformer-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/transformer-svg': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies: transitivePeerDependencies:
- '@swc/helpers' - '@swc/helpers'
- cssnano - cssnano
@ -6260,14 +6295,14 @@ snapshots:
'@parcel/core@2.12.0(@swc/helpers@0.5.12)': '@parcel/core@2.12.0(@swc/helpers@0.5.12)':
dependencies: dependencies:
'@mischnic/json-sourcemap': 0.1.1 '@mischnic/json-sourcemap': 0.1.1
'@parcel/cache': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/cache': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/events': 2.12.0 '@parcel/events': 2.12.0
'@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/graph': 3.2.0 '@parcel/graph': 3.2.0
'@parcel/logger': 2.12.0 '@parcel/logger': 2.12.0
'@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/profiler': 2.12.0 '@parcel/profiler': 2.12.0
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
@ -6318,14 +6353,13 @@ snapshots:
dependencies: dependencies:
chalk: 4.1.2 chalk: 4.1.2
'@parcel/namer-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/namer-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/node-resolver-core@3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))': '@parcel/node-resolver-core@3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
@ -6339,10 +6373,10 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
'@parcel/optimizer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/optimizer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
browserslist: 4.23.3 browserslist: 4.23.3
@ -6350,18 +6384,16 @@ snapshots:
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/optimizer-htmlnano@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)(postcss@8.4.41)(typescript@5.5.4)': '@parcel/optimizer-htmlnano@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(postcss@8.4.41)(typescript@5.5.4)':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
htmlnano: 2.1.1(postcss@8.4.41)(svgo@2.8.0)(typescript@5.5.4) htmlnano: 2.1.1(postcss@8.4.41)(svgo@2.8.0)(typescript@5.5.4)
nullthrows: 1.1.1 nullthrows: 1.1.1
posthtml: 0.16.6 posthtml: 0.16.6
svgo: 2.8.0 svgo: 2.8.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
- cssnano - cssnano
- postcss - postcss
- purgecss - purgecss
@ -6371,31 +6403,28 @@ snapshots:
- typescript - typescript
- uncss - uncss
'@parcel/optimizer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/optimizer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12) '@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
transitivePeerDependencies:
- '@swc/helpers'
'@parcel/optimizer-svgo@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/optimizer-svgo@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
svgo: 2.8.0 svgo: 2.8.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/optimizer-swc@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/optimizer-swc@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
'@swc/core': 1.7.6(@swc/helpers@0.5.12) '@swc/core': 1.7.6(@swc/helpers@0.5.12)
@ -6419,33 +6448,31 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- '@swc/helpers' - '@swc/helpers'
'@parcel/packager-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/packager-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
lightningcss: 1.26.0 lightningcss: 1.26.0
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/packager-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/packager-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
posthtml: 0.16.6 posthtml: 0.16.6
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/packager-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/packager-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
@ -6454,38 +6481,33 @@ snapshots:
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/packager-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/packager-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/packager-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/packager-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
posthtml: 0.16.6 posthtml: 0.16.6
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/packager-wasm@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/packager-wasm@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/plugin@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/plugin@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/profiler@2.12.0': '@parcel/profiler@2.12.0':
dependencies: dependencies:
@ -6493,79 +6515,71 @@ snapshots:
'@parcel/events': 2.12.0 '@parcel/events': 2.12.0
chrome-trace-event: 1.0.4 chrome-trace-event: 1.0.4
'@parcel/reporter-cli@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/reporter-cli@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
chalk: 4.1.2 chalk: 4.1.2
term-size: 2.2.1 term-size: 2.2.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/reporter-dev-server@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/reporter-dev-server@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/reporter-tracer@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/reporter-tracer@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
chrome-trace-event: 1.0.4 chrome-trace-event: 1.0.4
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/resolver-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/resolver-default@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/node-resolver-core': 3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12)) '@parcel/node-resolver-core': 3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-browser-hmr@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/runtime-browser-hmr@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/runtime-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-react-refresh@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/runtime-react-refresh@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
react-error-overlay: 6.0.9 react-error-overlay: 6.0.9
react-refresh: 0.9.0 react-refresh: 0.9.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/runtime-service-worker@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/runtime-service-worker@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/rust@2.12.0': {} '@parcel/rust@2.12.0': {}
@ -6573,10 +6587,10 @@ snapshots:
dependencies: dependencies:
detect-libc: 1.0.3 detect-libc: 1.0.3
'@parcel/transformer-babel@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-babel@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
browserslist: 4.23.3 browserslist: 4.23.3
@ -6585,12 +6599,11 @@ snapshots:
semver: 7.6.3 semver: 7.6.3
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-css@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
browserslist: 4.23.3 browserslist: 4.23.3
@ -6598,12 +6611,11 @@ snapshots:
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-html@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
posthtml: 0.16.6 posthtml: 0.16.6
@ -6613,23 +6625,20 @@ snapshots:
srcset: 4.0.0 srcset: 4.0.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-image@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12) '@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
'@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
nullthrows: 1.1.1 nullthrows: 1.1.1
transitivePeerDependencies:
- '@swc/helpers'
'@parcel/transformer-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))': '@parcel/transformer-js@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/core': 2.12.0(@swc/helpers@0.5.12) '@parcel/core': 2.12.0(@swc/helpers@0.5.12)
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
'@parcel/source-map': 2.1.1 '@parcel/source-map': 2.1.1
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
@ -6640,18 +6649,17 @@ snapshots:
regenerator-runtime: 0.13.11 regenerator-runtime: 0.13.11
semver: 7.6.3 semver: 7.6.3
'@parcel/transformer-json@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-json@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
json5: 2.2.3 json5: 2.2.3
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-postcss@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-postcss@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
clone: 2.1.2 clone: 2.1.2
@ -6660,11 +6668,10 @@ snapshots:
semver: 7.6.3 semver: 7.6.3
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-posthtml@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-posthtml@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
posthtml: 0.16.6 posthtml: 0.16.6
@ -6673,28 +6680,25 @@ snapshots:
semver: 7.6.3 semver: 7.6.3
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-raw@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-react-refresh-wrap@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-react-refresh-wrap@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
react-refresh: 0.9.0 react-refresh: 0.9.0
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/transformer-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/transformer-svg@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))':
dependencies: dependencies:
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/rust': 2.12.0 '@parcel/rust': 2.12.0
nullthrows: 1.1.1 nullthrows: 1.1.1
posthtml: 0.16.6 posthtml: 0.16.6
@ -6703,11 +6707,10 @@ snapshots:
semver: 7.6.3 semver: 7.6.3
transitivePeerDependencies: transitivePeerDependencies:
- '@parcel/core' - '@parcel/core'
- '@swc/helpers'
'@parcel/types@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)': '@parcel/types@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)':
dependencies: dependencies:
'@parcel/cache': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/cache': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/diagnostic': 2.12.0 '@parcel/diagnostic': 2.12.0
'@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
@ -10321,9 +10324,9 @@ snapshots:
'@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/logger': 2.12.0 '@parcel/logger': 2.12.0
'@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12)
'@parcel/reporter-cli': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/reporter-cli': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/reporter-dev-server': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/reporter-tracer': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))(@swc/helpers@0.5.12) '@parcel/reporter-tracer': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.12))
'@parcel/utils': 2.12.0 '@parcel/utils': 2.12.0
chalk: 4.1.2 chalk: 4.1.2
commander: 7.2.0 commander: 7.2.0

View File

@ -3,9 +3,10 @@ import path, { join } from "path"
import { mkdirP } from "@actions/io" import { mkdirP } from "@actions/io"
import { execaSync } from "execa" import { execaSync } from "execa"
import { readFile } from "fs/promises" import { readFile } from "fs/promises"
import { addPath } from "os-env"
import { dirname } from "patha" import { dirname } from "patha"
import which from "which" import which from "which"
import { addPath } from "../utils/env/addEnv" import { rcPath } from "../cli-options"
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
let binDir: string | undefined let binDir: string | undefined
@ -47,7 +48,7 @@ export async function setupBrew(_version: string, _setupDir: string, _arch: stri
}) })
binDir = getBrewPath() binDir = getBrewPath()
await addPath(binDir) await addPath(binDir, { rcPath })
return { binDir } return { binDir }
} }

View File

@ -1,11 +1,12 @@
/* eslint-disable require-atomic-updates */
import { execaSync } from "execa" import { execaSync } from "execa"
import { addPath } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { dirname } from "patha" import { dirname } from "patha"
import which from "which" import which from "which"
import { addPath } from "../utils/env/addEnv" import { rcPath } from "../cli-options"
import type { InstallationInfo } from "../utils/setup/setupBin" import type { InstallationInfo } from "../utils/setup/setupBin"
/* eslint-disable require-atomic-updates */
let binDir: string | undefined let binDir: string | undefined
export async function setupChocolatey( export async function setupChocolatey(
@ -54,7 +55,7 @@ export async function setupChocolatey(
) )
const chocoPath = `${process.env.ALLUSERSPROFILE}\\chocolatey\\bin` const chocoPath = `${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`
await addPath(chocoPath) await addPath(chocoPath, { rcPath })
const maybeChoco = which.sync("choco", { nothrow: true }) const maybeChoco = which.sync("choco", { nothrow: true })
if (maybeChoco !== null) { if (maybeChoco !== null) {

View File

@ -1,6 +1,7 @@
import { getInput } from "@actions/core" import { getInput } from "@actions/core"
import { info } from "ci-log" import { info } from "ci-log"
import mri from "mri" import mri from "mri"
import { untildifyUser } from "untildify-user"
import { type Inputs, inputs } from "./tool" import { type Inputs, inputs } from "./tool"
import type { InstallationInfo } from "./utils/setup/setupBin" import type { InstallationInfo } from "./utils/setup/setupBin"
@ -71,3 +72,5 @@ export function getSuccessMessage(tool: string, installationInfo: InstallationIn
} }
return msg return msg
} }
export const rcPath = untildifyUser("~/.cpprc")

View File

@ -1,13 +1,13 @@
import { join } from "path" import { join } from "path"
import { endGroup, notice, startGroup } from "@actions/core" import { endGroup, notice, startGroup } from "@actions/core"
import { error, info } from "ci-log" import { error, info } from "ci-log"
import { addEnv } from "os-env"
import semverValid from "semver/functions/valid" import semverValid from "semver/functions/valid"
import { getSuccessMessage } from "./cli-options" import { getSuccessMessage } from "./cli-options"
import { setupGcc, setupMingw } from "./gcc/gcc" import { setupGcc, setupMingw } from "./gcc/gcc"
import { activateGcovGCC, activateGcovLLVM } from "./gcovr/gcovr" import { activateGcovGCC, activateGcovLLVM } from "./gcovr/gcovr"
import { setupLLVM } from "./llvm/llvm" import { setupLLVM } from "./llvm/llvm"
import { setupMSVC } from "./msvc/msvc" import { setupMSVC } from "./msvc/msvc"
import { addEnv } from "./utils/env/addEnv"
import { getVersion } from "./versions/versions" import { getVersion } from "./versions/versions"
/** Detecting the compiler version. Divide the given string by `-` and use the second element as the version */ /** Detecting the compiler version. Divide the given string by `-` and use the second element as the version */

View File

@ -1,4 +1,5 @@
import { addPath } from "../utils/env/addEnv" import { addPath } from "os-env"
import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -37,6 +38,6 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
async function activateWinCppcheck() { async function activateWinCppcheck() {
const binDir = "C:/Program Files/Cppcheck" const binDir = "C:/Program Files/Cppcheck"
await addPath(binDir) await addPath(binDir, { rcPath })
return binDir return binDir
} }

View File

@ -1,7 +1,7 @@
import { info, notice } from "ci-log" import { info, notice } from "ci-log"
import { addPath } from "os-env"
import { addExeExt, join } from "patha" import { addExeExt, join } from "patha"
import { setupGraphviz } from "../graphviz/graphviz" import { setupGraphviz } from "../graphviz/graphviz"
import { addPath } from "../utils/env/addEnv"
import { extractTar, extractZip } from "../utils/setup/extract" import { extractTar, extractZip } from "../utils/setup/extract"
import { setupAptPack } from "../utils/setup/setupAptPack" import { setupAptPack } from "../utils/setup/setupAptPack"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin" import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
@ -12,6 +12,7 @@ import { getVersion } from "../versions/versions"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import retry from "retry-as-promised" import retry from "retry-as-promised"
import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -138,7 +139,7 @@ async function activateWinDoxygen() {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
if (await pathExists(join(binDir, "doxygen.exe"))) { if (await pathExists(join(binDir, "doxygen.exe"))) {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
await addPath(binDir) await addPath(binDir, { rcPath })
return binDir return binDir
} }
} }

View File

@ -1,4 +1,4 @@
import { addEnv, addPath } from "../utils/env/addEnv" import { addEnv, addPath } from "os-env"
import { GITHUB_ACTIONS } from "ci-info" import { GITHUB_ACTIONS } from "ci-info"
import { info, warning } from "ci-log" import { info, warning } from "ci-log"
@ -7,6 +7,7 @@ import { pathExists } from "path-exists"
import { addExeExt, join } from "patha" import { addExeExt, join } from "patha"
import semverCoerce from "semver/functions/coerce" import semverCoerce from "semver/functions/coerce"
import semverMajor from "semver/functions/major" import semverMajor from "semver/functions/major"
import { rcPath } from "../cli-options"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk" import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
@ -187,10 +188,10 @@ async function setupChocoMingw(version: string, arch: string): Promise<Installat
let binDir: string | undefined let binDir: string | undefined
if (arch === "x64" && (await pathExists("C:/tools/mingw64/bin"))) { if (arch === "x64" && (await pathExists("C:/tools/mingw64/bin"))) {
binDir = "C:/tools/mingw64/bin" binDir = "C:/tools/mingw64/bin"
await addPath(binDir) await addPath(binDir, { rcPath })
} else if (arch === "ia32" && (await pathExists("C:/tools/mingw32/bin"))) { } else if (arch === "ia32" && (await pathExists("C:/tools/mingw32/bin"))) {
binDir = "C:/tools/mingw32/bin" binDir = "C:/tools/mingw32/bin"
await addPath(binDir) await addPath(binDir, { rcPath })
} else if (await pathExists(`${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin/g++.exe`)) { } else if (await pathExists(`${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin/g++.exe`)) {
binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin` binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`
} }
@ -224,10 +225,10 @@ async function activateGcc(version: string, binDir: string, priority: number = 4
if (isUbuntu()) { if (isUbuntu()) {
promises.push( promises.push(
updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`, priority), updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`, rcPath, priority),
updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`, priority), updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`, rcPath, priority),
updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`, priority), updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`, rcPath, priority),
updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`, priority), updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`, rcPath, priority),
) )
} }
} else { } else {
@ -235,10 +236,10 @@ async function activateGcc(version: string, binDir: string, priority: number = 4
if (isUbuntu()) { if (isUbuntu()) {
promises.push( promises.push(
updateAptAlternatives("cc", `${binDir}/gcc-${version}`, priority), updateAptAlternatives("cc", `${binDir}/gcc-${version}`, rcPath, priority),
updateAptAlternatives("cxx", `${binDir}/g++-${version}`, priority), updateAptAlternatives("cxx", `${binDir}/g++-${version}`, rcPath, priority),
updateAptAlternatives("gcc", `${binDir}/gcc-${version}`, priority), updateAptAlternatives("gcc", `${binDir}/gcc-${version}`, rcPath, priority),
updateAptAlternatives("g++", `${binDir}/g++-${version}`, priority), updateAptAlternatives("g++", `${binDir}/g++-${version}`, rcPath, priority),
) )
} }
} }

View File

@ -1,6 +1,6 @@
import { addEnv } from "os-env"
import semverMajor from "semver/functions/major" import semverMajor from "semver/functions/major"
import semverValid from "semver/functions/valid" import semverValid from "semver/functions/valid"
import { addEnv } from "../utils/env/addEnv"
import { setupPipPack } from "../utils/setup/setupPipPack" import { setupPipPack } from "../utils/setup/setupPipPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars

View File

@ -1,4 +1,5 @@
import { addPath } from "../utils/env/addEnv" import { addPath } from "os-env"
import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -39,7 +40,7 @@ async function activateGraphviz(): Promise<InstallationInfo> {
switch (process.platform) { switch (process.platform) {
case "win32": { case "win32": {
const binDir = "C:/Program Files/Graphviz/bin" const binDir = "C:/Program Files/Graphviz/bin"
await addPath(binDir) await addPath(binDir, { rcPath })
return { binDir } return { binDir }
} }
default: { default: {

View File

@ -2,11 +2,12 @@ import { delimiter } from "path"
import { GITHUB_ACTIONS } from "ci-info" import { GITHUB_ACTIONS } from "ci-info"
import { info, warning } from "ci-log" import { info, warning } from "ci-log"
import memoize from "micro-memoize" import memoize from "micro-memoize"
import { addEnv } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { addExeExt, join } from "patha" import { addExeExt, join } from "patha"
import { rcPath } from "../cli-options"
import { setupGcc } from "../gcc/gcc" import { setupGcc } from "../gcc/gcc"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk" import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
import { addEnv } from "../utils/env/addEnv"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
import { ubuntuVersion } from "../utils/env/ubuntu_version" import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack" import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack"
@ -130,13 +131,13 @@ export async function activateLLVM(directory: string) {
if (isUbuntu()) { if (isUbuntu()) {
const priority = 60 const priority = 60
actPromises.push( actPromises.push(
updateAptAlternatives("cc", `${directory}/bin/clang`, priority), updateAptAlternatives("cc", `${directory}/bin/clang`, rcPath, priority),
updateAptAlternatives("cxx", `${directory}/bin/clang++`, priority), updateAptAlternatives("cxx", `${directory}/bin/clang++`, rcPath, priority),
updateAptAlternatives("clang", `${directory}/bin/clang`), updateAptAlternatives("clang", `${directory}/bin/clang`, rcPath),
updateAptAlternatives("clang++", `${directory}/bin/clang++`), updateAptAlternatives("clang++", `${directory}/bin/clang++`, rcPath),
updateAptAlternatives("lld", `${directory}/bin/lld`), updateAptAlternatives("lld", `${directory}/bin/lld`, rcPath),
updateAptAlternatives("ld.lld", `${directory}/bin/ld.lld`), updateAptAlternatives("ld.lld", `${directory}/bin/ld.lld`, rcPath),
updateAptAlternatives("llvm-ar", `${directory}/bin/llvm-ar`), updateAptAlternatives("llvm-ar", `${directory}/bin/llvm-ar`, rcPath),
) )
} }

View File

@ -2,8 +2,9 @@ import { info } from "console"
import { execRoot } from "admina" import { execRoot } from "admina"
import { execa } from "execa" import { execa } from "execa"
import { chmod, readFile, writeFile } from "fs/promises" import { chmod, readFile, writeFile } from "fs/promises"
import { addPath } from "os-env"
import { rcPath } from "../cli-options"
import { DEFAULT_TIMEOUT } from "../installTool" import { DEFAULT_TIMEOUT } from "../installTool"
import { addPath } from "../utils/env/addEnv"
import { aptTimeout, hasNala, isPackageRegexInstalled, setupAptPack } from "../utils/setup/setupAptPack" import { aptTimeout, hasNala, isPackageRegexInstalled, setupAptPack } from "../utils/setup/setupAptPack"
import type { InstallationInfo } from "../utils/setup/setupBin" import type { InstallationInfo } from "../utils/setup/setupBin"
@ -35,7 +36,7 @@ export async function setupLLVMApt(
}, },
) )
await addPath(`${installationFolder}/bin`) await addPath(`${installationFolder}/bin`, { rcPath })
return { return {
installDir: `${installationFolder}`, installDir: `${installationFolder}`,

View File

@ -1,6 +1,6 @@
import { getExecOutput } from "@actions/exec" import { getExecOutput } from "@actions/exec"
import { error } from "ci-log" import { error } from "ci-log"
import { addEnv } from "../utils/env/addEnv" import { addEnv } from "os-env"
export async function setupMacOSSDK() { export async function setupMacOSSDK() {
if (process.platform === "darwin") { if (process.platform === "darwin") {

View File

@ -5,15 +5,15 @@ import { GITHUB_ACTIONS, isCI } from "ci-info"
import { error, info, success, warning } from "ci-log" import { error, info, success, warning } from "ci-log"
import * as numerous from "numerous" import * as numerous from "numerous"
import numerousLocale from "numerous/locales/en.js" import numerousLocale from "numerous/locales/en.js"
import { finalizeRC } from "os-env"
import * as timeDelta from "time-delta" import * as timeDelta from "time-delta"
import timeDeltaLocale from "time-delta/locales/en.js" import timeDeltaLocale from "time-delta/locales/en.js"
import { untildifyUser } from "untildify-user" import { untildifyUser } from "untildify-user"
import { checkUpdates } from "./check-updates" import { checkUpdates } from "./check-updates"
import { parseArgs, printHelp } from "./cli-options" import { parseArgs, printHelp, rcPath } from "./cli-options"
import { installCompiler } from "./compilers" import { installCompiler } from "./compilers"
import { installTool } from "./installTool" import { installTool } from "./installTool"
import { tools } from "./tool" import { tools } from "./tool"
import { finalizeCpprc } from "./utils/env/addEnv"
import { isArch } from "./utils/env/isArch" import { isArch } from "./utils/env/isArch"
import { ubuntuVersion } from "./utils/env/ubuntu_version" import { ubuntuVersion } from "./utils/env/ubuntu_version"
import { setupPacmanPack } from "./utils/setup/setupPacmanPack" import { setupPacmanPack } from "./utils/setup/setupPacmanPack"
@ -115,7 +115,7 @@ async function main(args: string[]): Promise<number> {
} }
} }
await finalizeCpprc() await finalizeRC(rcPath)
if (successMessages.length === 0 && errorMessages.length === 0) { if (successMessages.length === 0 && errorMessages.length === 0) {
warning("setup-cpp was called without any arguments. Nothing to do.") warning("setup-cpp was called without any arguments. Nothing to do.")

View File

@ -1,4 +1,5 @@
import { addPath } from "../utils/env/addEnv" import { addPath } from "os-env"
import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -16,7 +17,7 @@ export async function setupMake(version: string, _setupDir: string, _arch: strin
} }
case "darwin": { case "darwin": {
await setupBrewPack("make", version) await setupBrewPack("make", version)
await addPath("/usr/local/opt/make/libexec/gnubin") await addPath("/usr/local/opt/make/libexec/gnubin", { rcPath })
return { binDir: "/usr/local/opt/make/libexec/gnubin" } return { binDir: "/usr/local/opt/make/libexec/gnubin" }
} }
case "linux": { case "linux": {

View File

@ -1,4 +1,5 @@
import { addPath } from "../utils/env/addEnv" import { addPath } from "os-env"
import { rcPath } from "../cli-options"
import { setupChocoPack } from "../utils/setup/setupChocoPack" import { setupChocoPack } from "../utils/setup/setupChocoPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
@ -13,6 +14,6 @@ export async function setupOpencppcoverage(version: string | undefined, _setupDi
async function activateOpencppcoverage() { async function activateOpencppcoverage() {
const binDir = "C:/Program Files/OpenCppCoverage" const binDir = "C:/Program Files/OpenCppCoverage"
await addPath(binDir) await addPath(binDir, { rcPath })
return binDir return binDir
} }

View File

@ -1,5 +1,6 @@
import { execRootSync } from "admina" import { execRootSync } from "admina"
import { addPath } from "../utils/env/addEnv" import { addPath } from "os-env"
import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -16,7 +17,7 @@ export async function setupPowershell(version: string | undefined, _setupDir: st
case "win32": { case "win32": {
await setupChocoPack("powershell-core", version) await setupChocoPack("powershell-core", version)
const binDir = "C:/Program Files/PowerShell/7" const binDir = "C:/Program Files/PowerShell/7"
await addPath(binDir) await addPath(binDir, { rcPath })
return { binDir } return { binDir }
} }
case "darwin": { case "darwin": {

View File

@ -7,10 +7,11 @@ import { info, warning } from "ci-log"
import { execa } from "execa" import { execa } from "execa"
import { readdir } from "fs/promises" import { readdir } from "fs/promises"
import memoize from "micro-memoize" import memoize from "micro-memoize"
import { addPath } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha" import { addExeExt, dirname, join } from "patha"
import which from "which" import which from "which"
import { addPath } from "../utils/env/addEnv" import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -134,7 +135,7 @@ async function setupPythonSystem(setupDir: string, version: string) {
} }
const binDir = dirname(bin) const binDir = dirname(bin)
/** The directory which the tool is installed to */ /** The directory which the tool is installed to */
await addPath(binDir) await addPath(binDir, { rcPath })
installInfo = { installDir: binDir, binDir, bin } installInfo = { installDir: binDir, binDir, bin }
break break
} }
@ -146,7 +147,7 @@ async function setupPythonSystem(setupDir: string, version: string) {
stderr: string stderr: string
} = await execa("brew", ["--prefix", "python"], { stdio: "pipe" }) } = await execa("brew", ["--prefix", "python"], { stdio: "pipe" })
const brewPythonBin = join(brewPythonPrefix.stdout, "libexec", "bin") const brewPythonBin = join(brewPythonPrefix.stdout, "libexec", "bin")
await addPath(brewPythonBin) await addPath(brewPythonBin, { rcPath })
break break
} }

View File

@ -1,235 +0,0 @@
import { delimiter } from "path"
import { exportVariable, addPath as ghAddPath, info, setFailed } from "@actions/core"
import { grantUserWriteAccess } from "admina"
import { GITHUB_ACTIONS } from "ci-info"
import { error, warning } from "ci-log"
import escapeSpace from "escape-path-with-spaces"
import escapeQuote from "escape-quotes"
import { execPowershell } from "exec-powershell"
import { appendFile, readFile, writeFile } from "fs/promises"
import { pathExists } from "path-exists"
import { untildifyUser } from "untildify-user"
type AddEnvOptions = {
/** If true, the value will be escaped with quotes and spaces will be escaped with backslash */
shouldEscapeSpace: boolean
/** If true, the variable will be only added if it is not defined */
shouldAddOnlyIfNotDefined: boolean
}
const defaultAddEnvOptions: AddEnvOptions = {
shouldEscapeSpace: false,
shouldAddOnlyIfNotDefined: false,
}
/**
* Add an environment variable.
*
* This function is cross-platforms and works in all the local or CI systems.
*/
export async function addEnv(
name: string,
valGiven: string | undefined,
givenOptions: Partial<AddEnvOptions> = defaultAddEnvOptions,
) {
const options = { ...defaultAddEnvOptions, ...givenOptions }
const val = escapeString(valGiven ?? "", options.shouldEscapeSpace)
try {
if (GITHUB_ACTIONS) {
try {
if (options.shouldAddOnlyIfNotDefined) {
if (process.env[name] !== undefined) {
info(`Environment variable ${name} is already defined. Skipping.`)
return
}
}
exportVariable(name, val)
} catch (err) {
error(err as Error)
await addEnvSystem(name, val, options)
}
} else {
await addEnvSystem(name, val, options)
}
} catch (err) {
error(err as Error)
setFailed(`Failed to export environment variable ${name}=${val}. You should add it manually.`)
}
}
function escapeString(valGiven: string, shouldEscapeSpace: boolean = false) {
const spaceEscaped = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
return escapeQuote(spaceEscaped, "\"", "\\")
}
const ignoredPaths = [/\/usr\/bin\/?/, /\/usr\/local\/bin\/?/]
/** Skip adding /usr/bin to PATH if it is already there */
function isIgnoredPath(path: string) {
if (ignoredPaths.some((checkedPath) => checkedPath.test(path))) {
const paths = process.env.PATH?.split(delimiter) ?? []
return paths.includes(path)
}
return false
}
/**
* Add a path to the PATH environment variable.
*
* This function is cross-platforms and works in all the local or CI systems.
*/
export async function addPath(path: string) {
if (isIgnoredPath(path)) {
return
}
process.env.PATH = `${path}${delimiter}${process.env.PATH}`
try {
if (GITHUB_ACTIONS) {
try {
ghAddPath(path)
} catch (err) {
error(err as Error)
await addPathSystem(path)
}
} else {
await addPathSystem(path)
}
} catch (err) {
error(err as Error)
setFailed(`Failed to add ${path} to the percistent PATH. You should add it manually.`)
}
}
export const cpprc_path = untildifyUser("~/.cpprc")
async function addEnvSystem(name: string, valGiven: string | undefined, options: AddEnvOptions) {
const val = valGiven ?? ""
switch (process.platform) {
case "win32": {
if (options.shouldAddOnlyIfNotDefined) {
if (process.env[name] !== undefined) {
info(`Environment variable ${name} is already defined. Skipping.`)
return
}
}
// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit
await execPowershell(`[Environment]::SetEnvironmentVariable('${name}', '${val}', "User")`)
info(`${name}='${val}' was set in the environment.`)
return
}
case "linux":
case "darwin": {
await sourceCpprc()
if (options.shouldAddOnlyIfNotDefined) {
await appendFile(cpprc_path, `\nif [ -z "\${${name}}" ]; then export ${name}="${val}"; fi\n`)
info(`if not defined ${name} then ${name}="${val}" was added to "${cpprc_path}`)
} else {
await appendFile(cpprc_path, `\nexport ${name}="${val}"\n`)
info(`${name}="${val}" was added to "${cpprc_path}`)
}
return
}
default: {
// fall through shell path modification
}
}
process.env[name] = val
}
async function addPathSystem(path: string) {
switch (process.platform) {
case "win32": {
// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit and also because %PATH% is different for user and system
await execPowershell(
`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${path};$USER_PATH", "User")`,
)
info(`"${path}" was added to the PATH.`)
return
}
case "linux":
case "darwin": {
await sourceCpprc()
await appendFile(cpprc_path, `\nexport PATH="${path}:$PATH"\n`)
info(`"${path}" was added to "${cpprc_path}"`)
return
}
default: {
return
}
}
}
/* eslint-disable require-atomic-updates */
let setupCppInProfile_called = false
/// handles adding conditions to source .cpprc file from .bashrc and .profile
export async function sourceCpprc() {
if (setupCppInProfile_called) {
return
}
const source_cpprc_string =
`\n# source .cpprc if SOURCE_CPPRC is not set to 0\nif [[ "$SOURCE_CPPRC" != 0 && -f "${cpprc_path}" ]]; then source "${cpprc_path}"; fi\n`
try {
await Promise.all([
addCpprcHeader(),
sourceCpprcInProfile(source_cpprc_string),
sourceCpprcInBashrc(source_cpprc_string),
])
} catch (err) {
warning(`Failed to add ${source_cpprc_string} to .profile or .bashrc. You should add it manually: ${err}`)
}
setupCppInProfile_called = true
}
async function addCpprcHeader() {
// a variable that prevents source_cpprc from being called from .bashrc and .profile
const cpprc_header = "# Automatically Generated by setup-cpp\nexport SOURCE_CPPRC=0"
if (await pathExists(cpprc_path)) {
const cpprc_content = await readFile(cpprc_path, "utf8")
if (!cpprc_content.includes(cpprc_header)) {
// already executed setupCppInProfile
await appendFile(cpprc_path, `\n${cpprc_header}\n`)
info(`Added ${cpprc_header} to ${cpprc_path}`)
}
}
}
async function sourceCpprcInBashrc(source_cpprc_string: string) {
const bashrc_path = untildifyUser("~/.bashrc")
if (await pathExists(bashrc_path)) {
const bashrcContent = await readFile(bashrc_path, "utf-8")
if (!bashrcContent.includes(source_cpprc_string)) {
await appendFile(bashrc_path, source_cpprc_string)
info(`${source_cpprc_string} was added to ${bashrc_path}`)
}
}
}
async function sourceCpprcInProfile(source_cpprc_string: string) {
const profile_path = untildifyUser("~/.profile")
if (await pathExists(profile_path)) {
const profileContent = await readFile(profile_path, "utf-8")
if (!profileContent.includes(source_cpprc_string)) {
await appendFile(profile_path, source_cpprc_string)
info(`${source_cpprc_string} was added to ${profile_path}`)
}
}
}
export async function finalizeCpprc() {
if (await pathExists(cpprc_path)) {
const entries = (await readFile(cpprc_path, "utf-8")).split("\n")
const unique_entries = [...new Set(entries.reverse())].reverse() // remove duplicates, keeping the latest entry
await writeFile(cpprc_path, unique_entries.join("\n"))
await grantUserWriteAccess(cpprc_path)
}
}

View File

@ -1,8 +0,0 @@
/** Escape `'` with `\\` */
declare function escapeQuote(input: string): string
/** Escape the given character with the given escape character */
declare function escapeQuote(input: string, character: string, escape_character: string): string
declare module "escape-quotes" {
export = escapeQuote
}

View File

@ -4,9 +4,9 @@ import { info, warning } from "ci-log"
import escapeRegex from "escape-string-regexp" import escapeRegex from "escape-string-regexp"
import { type ExecaError, execa } from "execa" import { type ExecaError, execa } from "execa"
import { appendFile } from "fs/promises" import { appendFile } from "fs/promises"
import { addEnv, sourceRC } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import which from "which" import which from "which"
import { addEnv, cpprc_path, sourceCpprc } from "../env/addEnv"
import type { InstallationInfo } from "./setupBin" import type { InstallationInfo } from "./setupBin"
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
@ -274,13 +274,13 @@ export async function addAptKeyViaDownload(name: string, url: string) {
return fileName return fileName
} }
export async function updateAptAlternatives(name: string, path: string, priority: number = 40) { export async function updateAptAlternatives(name: string, path: string, rcPath: string, priority: number = 40) {
if (GITHUB_ACTIONS) { if (GITHUB_ACTIONS) {
await execRoot("update-alternatives", ["--install", `/usr/bin/${name}`, name, path, priority.toString()]) await execRoot("update-alternatives", ["--install", `/usr/bin/${name}`, name, path, priority.toString()])
} else { } else {
await sourceCpprc() await sourceRC(rcPath)
await appendFile( await appendFile(
cpprc_path, rcPath,
`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} ${priority}; fi\n`, `\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} ${priority}; fi\n`,
) )
} }

View File

@ -1,13 +1,13 @@
import { cacheDir, downloadTool, find } from "@actions/tool-cache" import { cacheDir, downloadTool, find } from "@actions/tool-cache"
import { info } from "ci-log" import { info } from "ci-log"
import { addPath } from "os-env"
import { join } from "patha" import { join } from "patha"
import { addPath } from "../env/addEnv"
import { tmpdir } from "os" import { tmpdir } from "os"
import { GITHUB_ACTIONS } from "ci-info" import { GITHUB_ACTIONS } from "ci-info"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import retry from "retry-as-promised" import retry from "retry-as-promised"
import { maybeGetInput } from "../../cli-options" import { maybeGetInput, rcPath } from "../../cli-options"
import { hasDnf } from "../env/hasDnf" import { hasDnf } from "../env/hasDnf"
import { isArch } from "../env/isArch" import { isArch } from "../env/isArch"
import { isUbuntu } from "../env/isUbuntu" import { isUbuntu } from "../env/isUbuntu"
@ -74,7 +74,7 @@ export async function setupBin(
const binDir = join(installDir, binRelativeDir) const binDir = join(installDir, binRelativeDir)
if (await pathExists(join(binDir, binFileName))) { if (await pathExists(join(binDir, binFileName))) {
info(`${name} ${version} was found in the cache at ${binDir}.`) info(`${name} ${version} was found in the cache at ${binDir}.`)
await addPath(binDir) await addPath(binDir, { rcPath })
return { installDir, binDir } return { installDir, binDir }
} }
@ -129,7 +129,7 @@ export async function setupBin(
// Adding the bin dir to the path // Adding the bin dir to the path
/** The directory which the tool is installed to */ /** The directory which the tool is installed to */
info(`Add ${binDir} to PATH`) info(`Add ${binDir} to PATH`)
await addPath(binDir) await addPath(binDir, { rcPath })
// check if inside Github Actions. If so, cache the installation // check if inside Github Actions. If so, cache the installation
if (GITHUB_ACTIONS && typeof process.env.RUNNER_TOOL_CACHE === "string") { if (GITHUB_ACTIONS && typeof process.env.RUNNER_TOOL_CACHE === "string") {

View File

@ -1,9 +1,10 @@
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
import { info } from "ci-log" import { info } from "ci-log"
import { execaSync } from "execa" import { execaSync } from "execa"
import { addPath } from "os-env"
import which from "which" import which from "which"
import { setupChocolatey } from "../../chocolatey/chocolatey" import { setupChocolatey } from "../../chocolatey/chocolatey"
import { addPath } from "../env/addEnv" import { rcPath } from "../../cli-options"
import type { InstallationInfo } from "./setupBin" import type { InstallationInfo } from "./setupBin"
let hasChoco = false let hasChoco = false
@ -45,7 +46,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin
} }
const binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin` const binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`
await addPath(binDir) await addPath(binDir, { rcPath })
return { binDir } return { binDir }
} }

View File

@ -2,13 +2,14 @@ import { info } from "@actions/core"
import { execa, execaSync } from "execa" import { execa, execaSync } from "execa"
import memoize from "micro-memoize" import memoize from "micro-memoize"
import { mkdirp } from "mkdirp" import { mkdirp } from "mkdirp"
import { addPath } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha" import { addExeExt, dirname, join } from "patha"
import { untildifyUser } from "untildify-user" import { untildifyUser } from "untildify-user"
import which from "which" import which from "which"
import { rcPath } from "../../cli-options"
import { addPythonBaseExecPrefix, setupPython } from "../../python/python" import { addPythonBaseExecPrefix, setupPython } from "../../python/python"
import { getVersion } from "../../versions/versions" import { getVersion } from "../../versions/versions"
import { addPath } from "../env/addEnv"
import { hasDnf } from "../env/hasDnf" import { hasDnf } from "../env/hasDnf"
import { isArch } from "../env/isArch" import { isArch } from "../env/isArch"
import { isUbuntu } from "../env/isUbuntu" import { isUbuntu } from "../env/isUbuntu"
@ -85,7 +86,7 @@ export async function setupPipPackWithPython(
const execPaths = await addPythonBaseExecPrefix(givenPython) const execPaths = await addPythonBaseExecPrefix(givenPython)
const binDir = await findBinDir(execPaths, name) const binDir = await findBinDir(execPaths, name)
await addPath(binDir) await addPath(binDir, { rcPath })
return { binDir } return { binDir }
} }
@ -135,7 +136,7 @@ async function getPipxBinDir_raw() {
} }
const pipxBinDir = untildifyUser("~/.local/bin") const pipxBinDir = untildifyUser("~/.local/bin")
await addPath(pipxBinDir) await addPath(pipxBinDir, { rcPath })
await mkdirp(pipxBinDir) await mkdirp(pipxBinDir)
return pipxBinDir return pipxBinDir
} }

View File

@ -1,10 +1,11 @@
import { grantUserWriteAccess } from "admina" import { grantUserWriteAccess } from "admina"
import { info, notice } from "ci-log" import { info, notice } from "ci-log"
import { execaSync } from "execa" import { execaSync } from "execa"
import { addPath } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { addShExt, addShRelativePrefix, dirname, join } from "patha" import { addShExt, addShRelativePrefix, dirname, join } from "patha"
import which from "which" import which from "which"
import { addPath } from "../utils/env/addEnv" import { rcPath } from "../cli-options"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch" import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu" import { isUbuntu } from "../utils/env/isUbuntu"
@ -75,7 +76,7 @@ export async function setupVcpkg(version: string, setupDir: string, _arch: strin
await grantUserWriteAccess(setupDir) await grantUserWriteAccess(setupDir)
await addPath(setupDir) await addPath(setupDir, { rcPath })
// eslint-disable-next-line require-atomic-updates // eslint-disable-next-line require-atomic-updates
hasVCPKG = true hasVCPKG = true
return { binDir: setupDir } return { binDir: setupDir }

View File

@ -2,8 +2,8 @@
// @ts-ignore // @ts-ignore
import { info } from "ci-log" import { info } from "ci-log"
import { setupMSVCDevCmd } from "msvc-dev-cmd/lib.js" import { setupMSVCDevCmd } from "msvc-dev-cmd/lib.js"
import { addEnv } from "os-env"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import { addEnv } from "../utils/env/addEnv"
function getArch(arch: string): string { function getArch(arch: string): string {
switch (arch) { switch (arch) {

View File

@ -8,6 +8,7 @@
"noImplicitAny": true, "noImplicitAny": true,
"noImplicitThis": true, "noImplicitThis": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"declaration": true, "declaration": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
@ -34,6 +35,7 @@
"dev/scripts", "dev/scripts",
"packages/untildify-user/untildify.ts", "packages/untildify-user/untildify.ts",
"dev/docker/ci/docker-ci.mjs", "dev/docker/ci/docker-ci.mjs",
"./jest.config.ts" "./jest.config.ts",
"packages/os-env/src/escape-quotes.d.ts"
] ]
} }