File tree 4 files changed +12
-0
lines changed
4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 5
5
* Bumps clean-css dependency to 5.0.
6
6
* Bumps commander dependency to 7.0.
7
7
* 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.
8
9
9
10
[ 4.3.0 / 2019-04-06] ( https://github.com/jakubpawlowicz/clean-css-cli/compare/4.2...v4.3.0 )
10
11
==================
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ clean-css-cli 5.0 introduces the following changes / features:
66
66
67
67
* adds ` --batch ` option (off by default) which processes input files one by one without joining them together;
68
68
* adds ` --batch-suffix ` option to specify what gets appended to output filename in batch mode;
69
+ * automatically creates missing output directories;
69
70
* clean-css 5.0 with loads of bugfixes;
70
71
* drops official support for Node.js 4, 6, and 8;
71
72
* ` --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) {
349
349
350
350
function output ( process , outputPath , minified ) {
351
351
if ( outputPath ) {
352
+ fs . mkdirSync ( path . dirname ( outputPath ) , { recursive : true } ) ;
352
353
fs . writeFileSync ( outputPath , minified , 'utf8' ) ;
353
354
} else {
354
355
process . stdout . write ( minified ) ;
Original file line number Diff line number Diff line change @@ -196,6 +196,15 @@ vows.describe('cleancss')
196
196
teardown : function ( ) {
197
197
deleteFile ( './reset1-min.css' ) ;
198
198
}
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
+ }
199
208
} )
200
209
} )
201
210
. addBatch ( {
You can’t perform that action at this time.
0 commit comments