Skip to content

Commit

Permalink
Merge pull request #301 from hannu/improve-bin-params
Browse files Browse the repository at this point in the history
Possibility to pass a single stylefile to executable
  • Loading branch information
Juuso Backman committed Dec 1, 2014
2 parents 4a76ba7 + 65b3ff8 commit 2246912
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Using from the command line

**-s, --source**

Source directory of stylesheets
Source directory of stylesheets or path to a single file

**-o, --output**

Expand Down
8 changes: 7 additions & 1 deletion bin/styleguide
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var styleguide = require(__dirname + '/../lib/styleguide.js'),
neat = require('node-neat'),
util = require('gulp-util'),
extend = require('node.extend'),
fs = require('fs'),
argv,
gulpProcess,
config,
Expand Down Expand Up @@ -37,7 +38,12 @@ argv = yargs
.argv;

sourcePath = path.resolve(argv.source);
sourceFiles = [sourcePath + '/**/*.css', sourcePath + '/**/*.scss', sourcePath + '/**/*.less'];
if (fs.lstatSync(sourcePath).isDirectory()) {
sourceFiles = [sourcePath + '/**/*.css', sourcePath + '/**/*.scss', sourcePath + '/**/*.less'];
} else {
sourceFiles = [sourcePath];
}

outputPath = path.resolve(argv.output);
configPath = argv.config ? path.resolve(argv.config) : undefined;
config = configPath ? require(configPath) : {};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@
"test-coverage": "node_modules/gulp/bin/gulp.js test-coverage",
"prepublish": "node_modules/gulp/bin/gulp.js build",
"build": "node_modules/gulp/bin/gulp.js build",
"demo": "./bin/styleguide --output demo-output --source ./lib/app --config ./lib/app/styleguide_config.json --server --watch"
"demo": "./bin/styleguide --output demo-output --source ./lib/app/sass/app.scss --config ./lib/app/styleguide_config.json --server --watch"
}
}

0 comments on commit 2246912

Please sign in to comment.