From 14e988ffd4647aeaebf81046c868f1aa9e4be26c Mon Sep 17 00:00:00 2001 From: dmc Date: Mon, 5 Feb 2024 21:19:52 +0100 Subject: [PATCH] source file comment --- lib/system-status.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/system-status.js b/lib/system-status.js index 10df3ee..04a0aa5 100644 --- a/lib/system-status.js +++ b/lib/system-status.js @@ -211,17 +211,17 @@ customElements.define('system-status', class extends HTMLElement { }) }) } - + const comment = '# Added by Pear Runtime, configures system with Pear CLI\n' const profiles = Object.values(this.shellProfiles) if (profiles.length > 0) { for (const { filepath, hasPear } of profiles) { - if (hasPear === false) fs.writeFileSync(filepath, '\n' + this.statement + '\n', { flag: 'a' }) + if (hasPear === false) fs.writeFileSync(filepath, '\n' + comment + this.statement + '\n', { 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', { flag: 'a' }) - if (zsh) fs.writeFileSync(path.join(os.homedir(), '.zshrc'), this.statement + '\n', { flag: 'a' }) + if (zsh) fs.writeFileSync(path.join(os.homedir(), '.zshrc'), '\n' + comment + this.statement + '\n', { flag: 'a' }) } const pear = path.join(BIN, 'pear')