File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed
Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 55* Bumps clean-css dependency to 5.0.
66* Bumps commander dependency to 7.0.
77* Fixed issue [ #18 ] ( https://github.com/jakubpawlowicz/clean-css-cli/issues/18 ) - allows batch processing of input files.
8+ * Fixed issue [ #36 ] ( https://github.com/jakubpawlowicz/clean-css-cli/issues/36 ) - automatically creates missing output directories.
89
910[ 4.3.0 / 2019-04-06] ( https://github.com/jakubpawlowicz/clean-css-cli/compare/4.2...v4.3.0 )
1011==================
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ clean-css-cli 5.0 introduces the following changes / features:
6666
6767* adds ` --batch ` option (off by default) which processes input files one by one without joining them together;
6868* adds ` --batch-suffix ` option to specify what gets appended to output filename in batch mode;
69+ * automatically creates missing output directories;
6970* clean-css 5.0 with loads of bugfixes;
7071* drops official support for Node.js 4, 6, and 8;
7172* ` --skip-rebase ` option has been removed as rebasing URLs is disabled by default now
Original file line number Diff line number Diff line change @@ -349,6 +349,7 @@ function getSourceMapContent(sourceMapPath) {
349349
350350function output ( process , outputPath , minified ) {
351351 if ( outputPath ) {
352+ fs . mkdirSync ( path . dirname ( outputPath ) , { recursive : true } ) ;
352353 fs . writeFileSync ( outputPath , minified , 'utf8' ) ;
353354 } else {
354355 process . stdout . write ( minified ) ;
Original file line number Diff line number Diff line change @@ -196,6 +196,15 @@ vows.describe('cleancss')
196196 teardown : function ( ) {
197197 deleteFile ( './reset1-min.css' ) ;
198198 }
199+ } ) ,
200+ 'to file when target path does not exist' : binaryContext ( '-o ./test/fixtures-temp/reset-min.css ./test/fixtures/reset.css' , {
201+ 'should create a directory and optimized file' : function ( ) {
202+ assert . isTrue ( fs . existsSync ( 'test/fixtures-temp' ) ) ;
203+ assert . isTrue ( fs . existsSync ( 'test/fixtures-temp/reset-min.css' ) ) ;
204+ } ,
205+ teardown : function ( ) {
206+ exec ( 'rm -rf test/fixtures-temp' ) ;
207+ }
199208 } )
200209 } )
201210 . addBatch ( {
You can’t perform that action at this time.
0 commit comments