mirror of https://github.com/aminya/setup-cpp
fix: add a new line before/after the guard headers
This commit is contained in:
parent
c0d283fa60
commit
a06af07c8d
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
|
@ -18,8 +18,8 @@ export type RcOptions = {
|
||||||
|
|
||||||
async function sourceRCInRc_(options: RcOptions) {
|
async function sourceRCInRc_(options: RcOptions) {
|
||||||
const sourceRcString = options.guard === undefined
|
const sourceRcString = options.guard === undefined
|
||||||
? `source "${options.rcPath}"`
|
? `\nsource "${options.rcPath}"\n`
|
||||||
: `# ${options.guard}\nif [[ "$SOURCE_${options.guard.toUpperCase()}RC" != 0 && -f "${options.rcPath}" ]]; then source "${options.rcPath}"; fi`
|
: `\n# ${options.guard}\nif [[ "$SOURCE_${options.guard.toUpperCase()}RC" != 0 && -f "${options.rcPath}" ]]; then source "${options.rcPath}"; fi\n`
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
@ -40,8 +40,8 @@ export const sourceRCInRc = memoize(sourceRCInRc_, { isPromise: true })
|
||||||
async function addRCHeader(options: RcOptions) {
|
async function addRCHeader(options: RcOptions) {
|
||||||
// a variable that prevents source rc from being called from .bashrc and .profile
|
// a variable that prevents source rc from being called from .bashrc and .profile
|
||||||
const rcHeader = options.guard === undefined
|
const rcHeader = options.guard === undefined
|
||||||
? "# Automatically Generated by os-env"
|
? "\n# Automatically Generated by os-env\n"
|
||||||
: `# Automatically Generated by os-env ${options.guard}\nexport SOURCE_${options.guard.toUpperCase()}RC=0`
|
: `\n# Automatically Generated by os-env ${options.guard}\nexport SOURCE_${options.guard.toUpperCase()}RC=0\n`
|
||||||
|
|
||||||
if (await pathExists(options.rcPath)) {
|
if (await pathExists(options.rcPath)) {
|
||||||
const rcContent = await readFile(options.rcPath, "utf8")
|
const rcContent = await readFile(options.rcPath, "utf8")
|
||||||
|
|
|
@ -16,7 +16,7 @@ let didUpdate: boolean = false
|
||||||
let didInit: boolean = false
|
let didInit: boolean = false
|
||||||
|
|
||||||
// wait up to 300 seconds if the apt-get lock is held
|
// wait up to 300 seconds if the apt-get lock is held
|
||||||
export const aptTimeout = "DPkg::Lock::Timeout=300"
|
export const aptTimeout = "Dpkg::Lock::Timeout=300"
|
||||||
|
|
||||||
export type AptPackage = {
|
export type AptPackage = {
|
||||||
name: string
|
name: string
|
||||||
|
|
Loading…
Reference in New Issue