Skip to content

Commit

Permalink
fix(project): config init error
Browse files Browse the repository at this point in the history
  • Loading branch information
drawnepicenter committed Jan 25, 2017
1 parent 7c7e504 commit 8b0bfa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bin/themes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const fs = require('fs')
const glob = require('glob')
const noon = require('noon')

const CFILE = `${process.env.HOME}/.leximaven.noon`
const config = noon.load(CFILE)

let TDIR = null
let themeDirExists = null
try {
Expand Down Expand Up @@ -38,6 +35,8 @@ exports.loadTheme = (theme) => {
} catch (e) {
if (e.code === 'ENOENT') dirExists = false
}
const CFILE = `${process.env.HOME}/.leximaven.noon`
const config = noon.load(CFILE)
if (!dirExists && config.verbose) console.log(chalk.white(`${process.cwd()}/themes does not exist, falling back to ${process.env.NODE_PATH}/leximaven/themes.`))
load = noon.load(`${TDIR}${theme}.noon`)
return load
Expand All @@ -58,6 +57,8 @@ exports.getThemes = () => {
} catch (e) {
if (e.code === 'ENOENT') dirExists = false
}
const CFILE = `${process.env.HOME}/.leximaven.noon`
const config = noon.load(CFILE)
if (!dirExists && config.verbose) console.log(chalk.white(`${process.cwd()}/themes does not exist, falling back to ${process.env.NODE_PATH}/leximaven/themes.`))
files = glob.sync(`${TDIR}*.noon`)
for (let i = 0; i <= files.length - 1; i++) {
Expand Down

0 comments on commit 8b0bfa1

Please sign in to comment.