diff --git a/lib/system-status.js b/lib/system-status.js index c8103a4..d77ee13 100644 --- a/lib/system-status.js +++ b/lib/system-status.js @@ -105,7 +105,6 @@ customElements.define('system-status', class extends HTMLElement { this.shellProfiles[file] = { filepath, hasPear: this.stmtrx.test(contents) } hasPear = hasPear || this.shellProfiles[file].hasPear } - console.log('hi', contents, hasPear, this.stmtrx, this.shellProfiles[file]) } if (hasPear) process.env.PATH = `${BIN}:${process.env.PATH}` } @@ -151,13 +150,13 @@ customElements.define('system-status', class extends HTMLElement { const profiles = Object.values(this.shellProfiles) if (profiles.length > 0) { for (const { filepath, hasPear } of profiles) { - if (hasPear === false) fs.writeFileSync(filepath, this.statement, { flags: 'a' }) + if (hasPear === false) fs.writeFileSync(filepath, this.statement, { flag: 'a' }) } } 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', { flags: 'a' }) - if (zsh) fs.writeFileSync(path.join(os.homedir(), '.zshrc'), this.statement + '\n', { flags: 'a' }) + fs.writeFileSync(path.join(os.homedir(), bash ? '.bashrc' : '.profile'), this.statement + '\n', { flag: 'a' }) + if (zsh) fs.writeFileSync(path.join(os.homedir(), '.zshrc'), this.statement + '\n', { flag: 'a' }) } const pear = path.join(BIN, 'pear')