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) {
|
||||
const sourceRcString = options.guard === undefined
|
||||
? `source "${options.rcPath}"`
|
||||
: `# ${options.guard}\nif [[ "$SOURCE_${options.guard.toUpperCase()}RC" != 0 && -f "${options.rcPath}" ]]; then source "${options.rcPath}"; fi`
|
||||
? `\nsource "${options.rcPath}"\n`
|
||||
: `\n# ${options.guard}\nif [[ "$SOURCE_${options.guard.toUpperCase()}RC" != 0 && -f "${options.rcPath}" ]]; then source "${options.rcPath}"; fi\n`
|
||||
|
||||
try {
|
||||
await Promise.all([
|
||||
|
@ -40,8 +40,8 @@ export const sourceRCInRc = memoize(sourceRCInRc_, { isPromise: true })
|
|||
async function addRCHeader(options: RcOptions) {
|
||||
// a variable that prevents source rc from being called from .bashrc and .profile
|
||||
const rcHeader = options.guard === undefined
|
||||
? "# Automatically Generated by os-env"
|
||||
: `# Automatically Generated by os-env ${options.guard}\nexport SOURCE_${options.guard.toUpperCase()}RC=0`
|
||||
? "\n# Automatically Generated by os-env\n"
|
||||
: `\n# Automatically Generated by os-env ${options.guard}\nexport SOURCE_${options.guard.toUpperCase()}RC=0\n`
|
||||
|
||||
if (await pathExists(options.rcPath)) {
|
||||
const rcContent = await readFile(options.rcPath, "utf8")
|
||||
|
|
|
@ -16,7 +16,7 @@ let didUpdate: boolean = false
|
|||
let didInit: boolean = false
|
||||
|
||||
// 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 = {
|
||||
name: string
|
||||
|
|
Loading…
Reference in New Issue