mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Make RcParser ignore errors at JSON.parse()
This commit is contained in:
@@ -7,7 +7,13 @@ function parse () {
|
||||
const boostnotercPath = path.join(homePath, BOOSTNOTERC)
|
||||
|
||||
if (!sander.existsSync(boostnotercPath)) return {}
|
||||
return JSON.parse(sander.readFileSync(boostnotercPath).toString())
|
||||
try {
|
||||
return JSON.parse(sander.readFileSync(boostnotercPath).toString())
|
||||
} catch (e) {
|
||||
console.warn(e)
|
||||
console.warn('Your .boostnoterc is broken so it\'s not used.')
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user