From ded42d5c2fe6a0cb6d29936b3dbf7afc1b8ede44 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 20 Nov 2022 21:19:18 -0800 Subject: [PATCH] fix: make cpprc editable by the user --- src/utils/env/addEnv.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/env/addEnv.ts b/src/utils/env/addEnv.ts index 00fa6530..b37d048e 100644 --- a/src/utils/env/addEnv.ts +++ b/src/utils/env/addEnv.ts @@ -6,6 +6,7 @@ import { error, warning } from "ci-log" import { execPowershell } from "exec-powershell" import { delimiter } from "path" import escapeSpace from "escape-path-with-spaces" +import { giveUserAccess } from "user-access" /** * Add an environment variable. @@ -125,6 +126,10 @@ export function setupCppInProfile() { appendFileSync(cpprc_path, `\n${source_cpprc_str}\n`) info(`Added ${source_cpprc_str} to ${cpprc_path}`) + giveUserAccess(cpprc_path) + + // source cpprc in bashrc/profile + 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 {