Comparing version 0.1.1 to 0.1.2
12
index.js
@@ -14,7 +14,13 @@ 'use strict'; | ||
parse(destFile, options) { | ||
let globs = glob.sync(this.files); | ||
let files; | ||
options || {}; | ||
if (Array.isArray(this.files)) { | ||
files = this.files; | ||
} else { | ||
files = glob.sync(this.files); | ||
} | ||
// Check if has any file | ||
if (globs.length === 0) { | ||
if (files.length === 0) { | ||
console.error(`Has no file in ${this.files}!`); | ||
@@ -24,3 +30,3 @@ process.exit(); | ||
globs.forEach((file) => { | ||
files.forEach((file) => { | ||
let fileContent = fs.readFileSync(file); | ||
@@ -27,0 +33,0 @@ dss.parse(fileContent, options, (parsedObject) => { |
{ | ||
"name": "doki", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Generates a JSON with your styleguide's data", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -23,3 +23,3 @@ <div align="center"> | ||
// @description Your standard form button. | ||
// | ||
// | ||
// @state :hover - Highlights when hovering. | ||
@@ -29,6 +29,6 @@ // @state :disabled - Dims the button when disabled. | ||
// @state .smaller - A smaller button | ||
// | ||
// | ||
// @markup | ||
// <button>This is a button</button> | ||
// | ||
// | ||
``` | ||
@@ -42,3 +42,3 @@ | ||
"state": [ | ||
{ | ||
{ | ||
"name": ":hover", | ||
@@ -76,3 +76,3 @@ "escaped": "pseudo-class-hover", | ||
#### class Doki(sourceFile) | ||
The constructor accept any patter from [glob](https://www.npmjs.com/package/glob#glob-primer). | ||
The constructor accept any patter from [glob](https://www.npmjs.com/package/glob#glob-primer) or an array of files. | ||
@@ -79,0 +79,0 @@ ```js |
5051
35