Skip to content

Commit

Permalink
Bugfix, fix a export bug in lib cli
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yu committed May 12, 2015
1 parent 077d4b8 commit 65ff3b0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
25 changes: 19 additions & 6 deletions dist/cli.js

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

2 changes: 1 addition & 1 deletion dist/cli.js.map

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

12 changes: 7 additions & 5 deletions lib/cli.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import fs from 'fs'
import path from 'path'
import consoler from 'consoler'
import docor from './docor'
import * as docor from './docor'

const files = ['README.md', 'LICENSE', '.gitignore', '.npmignore']

let checkPackage = (file) => {
let checkPackage = (f) => {
return fs.existsSync(
path.join(process.cwd(), file)
path.join(process.cwd(), f)
)
}

(() => {
// Add a `;` to prevent compile error.
// It's a bebel's bug ? XD
export default function() {
if (!checkPackage('package.json'))
return consoler.error('Docor.init(); `package.json` file not found')

Expand All @@ -23,4 +25,4 @@ let checkPackage = (file) => {
consoler.success(file + ' created')
})
})
})()
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"license": "MIT",
"bin": "bin/cli",
"scripts": {
"build": "node_modules/.bin/babel lib --out-dir dist --source-maps",
"build": "node_modules/.bin/babel lib --out-dir dist --source-map",
"build": "node_modules/.bin/babel lib --out-dir dist --source-maps --watch",
"example": "cd ./example && ../bin/cli"
},
"repository": {
Expand Down

0 comments on commit 65ff3b0

Please sign in to comment.