mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Fix a return value of RcParser.parse
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import _ from 'lodash'
|
||||
import path from 'path'
|
||||
import sander from 'sander'
|
||||
|
||||
const path = require('path')
|
||||
const sander = require('sander')
|
||||
function parse () {
|
||||
const BOOSTNOTERC = '.boostnoterc'
|
||||
const homePath = global.process.env.HOME || global.process.env.USERPROFILE
|
||||
const boostnotercPath = path.join(homePath, BOOSTNOTERC)
|
||||
|
||||
function parse (boostnotercPath) {
|
||||
if (!sander.existsSync(boostnotercPath)) return
|
||||
let config = JSON.parse(sander.readFileSync(boostnotercPath).toString())
|
||||
return config
|
||||
if (!sander.existsSync(boostnotercPath)) return {}
|
||||
return JSON.parse(sander.readFileSync(boostnotercPath).toString())
|
||||
}
|
||||
|
||||
function exec (boostnotercPath) {
|
||||
|
||||
Reference in New Issue
Block a user