1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Change RcParser testable

This commit is contained in:
asmsuechan
2017-08-12 09:11:22 +09:00
parent f05e256afc
commit 9405b95825

View File

@@ -1,11 +1,11 @@
import path from 'path'
import sander from 'sander'
function parse () {
const BOOSTNOTERC = '.boostnoterc'
const homePath = global.process.env.HOME || global.process.env.USERPROFILE
const boostnotercPath = path.join(homePath, BOOSTNOTERC)
const BOOSTNOTERC = '.boostnoterc'
const homePath = global.process.env.HOME || global.process.env.USERPROFILE
const _boostnotercPath = path.join(homePath, BOOSTNOTERC)
function parse (boostnotercPath = _boostnotercPath) {
if (!sander.existsSync(boostnotercPath)) return {}
try {
return JSON.parse(sander.readFileSync(boostnotercPath).toString())