{"record":{"id":"38af71133f796e4c","repo":"paperclipai/paperclip","slug":"refusing-to-modify-non-regular-shell-rc-file-rcp","errorCode":null,"errorMessage":"Refusing to modify non-regular shell rc file ${rcPath}.","messagePattern":"Refusing to modify non-regular shell rc file (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/install-store.ts","lineNumber":434,"sourceCode":"    fs.rmSync(paths.shimPath, { force: true });\n    return true;\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return true;\n    throw error;\n  }\n}\n\nexport function managedPathBlock(): string {\n  return `${PATH_BLOCK_START}\\nexport PATH=\"$HOME/.local/bin:$PATH\"\\n${PATH_BLOCK_END}`;\n}\n\nexport function addManagedPathBlock(rcPath: string): boolean {\n  let existing = \"\";\n  let mode = 0o600;\n  try {\n    const stat = fs.lstatSync(rcPath);\n    if (!stat.isFile() || stat.isSymbolicLink()) {\n      throw new Error(`Refusing to modify non-regular shell rc file ${rcPath}.`);\n    }\n    assertOwnedByCurrentUser(stat, rcPath);\n    mode = stat.mode & 0o777;\n    existing = fs.readFileSync(rcPath, \"utf8\");\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n  }\n  if (existing.includes(PATH_BLOCK_START)) return false;\n  fs.mkdirSync(path.dirname(rcPath), { recursive: true });\n  const prefix = existing.length > 0 && !existing.endsWith(\"\\n\") ? \"\\n\" : \"\";\n  writeFileAtomic(rcPath, `${existing}${prefix}${managedPathBlock()}\\n`, mode);\n  return true;\n}\n\nexport function removeManagedPathBlock(rcPath: string): boolean {\n  let existing: string;\n  let mode: number;\n  try {","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/install-store.ts#L416-L452","documentation":"addManagedPathBlock lstat'ed the shell rc file and found it is not a regular unlinked file, so the guard refuses to append the PATH block to unsafe rc files (e.g. symlinks).","triggerScenarios":"Thrown at cli/src/install-store.ts:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure ${rcPath} is a regular file (not a symlink or device) owned by you, then retry.","Update your shell rc file manually."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}