Skip to content

Commit c122e5f

Browse files
committed
Merge pull request postcss#19 from watilde/release/v2.5.2
Release/v2.5.2
2 parents 9bc847e + 67d027b commit c122e5f

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

History.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2.5.2 / 2016-04-18
2+
==================
3+
4+
* Fix typo in help message: -use => [--use|-u]
5+
* npm install --save mkdirp
6+
* Support mkdirp to create dest path if it doesn't exists
7+
* Fix booleans in config file
18

29
2.5.1 / 2016-02-11
310
==================
@@ -113,7 +120,7 @@
113120
0.3.0 / 2015-03-19
114121
==================
115122

116-
* support JS format as plugins config
123+
* support JS format as plugins config
117124

118125
0.2.0 / 2015-03-13
119126
==================

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ test/build/js-config-all.css: test/in.css
9292
./bin/postcss -c test/config-all.js
9393
$(DIFF) $@ $(subst build,ref,$@)
9494

95+
test/build/mkdirp/in.css: test/in.css
96+
./bin/postcss -u postcss-url -o $@ $<
97+
$(DIFF) $@ $(subst build,ref,$@)
98+
9599
test/build:
96100
mkdir -p $@
97101

index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var globby = require("globby");
22
var resolve = require("resolve");
33
var argv = require("yargs")
4-
.usage('Usage: $0 -use plugin [--config|-c config.json] [--output|-o output.css] [input.css]')
4+
.usage('Usage: $0 [--use|-u] plugin [--config|-c config.json] [--output|-o output.css] [input.css]')
55
.example('postcss --use autoprefixer -c options.json -o screen.css screen.css',
66
'Use autoprefixer as a postcss plugin')
77
.example('postcss --use autoprefixer --autoprefixer.browsers "> 5%" -o screen.css screen.css',
@@ -128,10 +128,12 @@ if (mapOptions === 'file') {
128128

129129
var async = require('neo-async');
130130
var fs = require('fs');
131+
var path = require('path');
131132
var readFile = require('read-file-stdin');
132133
var path = require('path');
133134
var postcss = require('postcss');
134135
var processor = postcss(plugins);
136+
var mkdirp = require('mkdirp');
135137

136138
// hook for dynamically updating the list of watched files
137139
global.watchCSS = function() {};
@@ -247,5 +249,12 @@ function writeFile(name, content, fn) {
247249
process.stdout.write(content);
248250
return fn();
249251
}
250-
fs.writeFile(name, content, fn);
252+
253+
mkdirp(path.dirname(name), function (err) {
254+
if (err) {
255+
fn(err);
256+
} else {
257+
fs.writeFile(name, content, fn);
258+
}
259+
});
251260
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
"license": "MIT",
2020
"dependencies": {
2121
"globby": "^3.0.1",
22+
"mkdirp": "^0.5.1",
2223
"neo-async": "^1.0.0",
2324
"postcss": "^5.0.0",
2425
"read-file-stdin": "^0.2.0",
2526
"resolve": "^1.1.6",
26-
"yargs": "^3.8.0"
27+
"yargs": "^3.32.0"
2728
},
2829
"optionalDependencies": {
2930
"chokidar": "^1.0.3"
@@ -33,4 +34,4 @@
3334
"postcss-import": "^7.1.0",
3435
"postcss-url": "^4.0.0"
3536
}
36-
}
37+
}

0 commit comments

Comments
 (0)