Skip to content

Commit b991e68

Browse files
authored
Merge pull request #26 from albekov/master
Escape backslashes in Windows paths
2 parents 00df393 + 04a97f2 commit b991e68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const fs = require("fs");
22
const crypto = require("crypto");
33
const crossSpawn = require("cross-spawn");
4+
const path = require("path");
45
const stripIndent = require("common-tags/lib/stripIndent");
56
const THIS_FILE = fs.readFileSync(__filename);
67

@@ -59,11 +60,11 @@ module.exports = {
5960
// but postcss is async. So we spawn a sync process to do an sync
6061
// transformation!
6162
// https://twitter.com/kentcdodds/status/1043194634338324480
62-
const postcssRunner = `${__dirname}/postcss-runner.js`;
63+
const postcssRunner = JSON.stringify(path.join(__dirname, "postcss-runner.js"));
6364
const result = crossSpawn.sync("node", [
6465
"-e",
6566
stripIndent`
66-
require("${postcssRunner}")(
67+
require(${postcssRunner})(
6768
${JSON.stringify({
6869
src,
6970
filename,

0 commit comments

Comments
 (0)