shell profile overwrite gaurd

This commit is contained in:
dmc
2024-01-15 19:53:32 +01:00
parent d0ed30d7f8
commit d28d55fab8

View File

@@ -156,8 +156,8 @@ customElements.define('system-status', class extends HTMLElement {
} else {
const bash = this.paths.some((bin) => fs.existsSync(path.join(bin, 'bash')))
const zsh = this.paths.some((bin) => fs.existsSync(path.join(bin, 'zsh')))
fs.writeFileSync(path.join(os.homedir(), bash ? '.bashrc' : '.profile'), this.statement + '\n')
if (zsh) fs.writeFileSync(path.join(os.homedir(), '.zshrc'), this.statement + '\n')
fs.writeFileSync(path.join(os.homedir(), bash ? '.bashrc' : '.profile'), this.statement + '\n', { flags: 'a' })
if (zsh) fs.writeFileSync(path.join(os.homedir(), '.zshrc'), this.statement + '\n', { flags: 'a' })
}
const pear = path.join(BIN, 'pear')