mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 14:34:19 +01:00
source file comment
This commit is contained in:
@@ -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)
|
const profiles = Object.values(this.shellProfiles)
|
||||||
if (profiles.length > 0) {
|
if (profiles.length > 0) {
|
||||||
for (const { filepath, hasPear } of profiles) {
|
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 {
|
} else {
|
||||||
const bash = this.paths.some((bin) => fs.existsSync(path.join(bin, 'bash')))
|
const bash = this.paths.some((bin) => fs.existsSync(path.join(bin, 'bash')))
|
||||||
const zsh = this.paths.some((bin) => fs.existsSync(path.join(bin, 'zsh')))
|
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' })
|
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')
|
const pear = path.join(BIN, 'pear')
|
||||||
|
|||||||
Reference in New Issue
Block a user