broccoli-output-wrapper
Advanced tools
Comparing version 3.2.3 to 3.2.4
@@ -49,2 +49,7 @@ "use strict"; | ||
} | ||
case 'mkdirSync': { | ||
if (fsArguments[0] && fsArguments[0].recursive) { | ||
return fs_extra_1.mkdirpSync(outputPath); | ||
} | ||
} | ||
default: | ||
@@ -51,0 +56,0 @@ return target[propertyName](outputPath, ...fsArguments); |
{ | ||
"name": "broccoli-output-wrapper", | ||
"version": "3.2.3", | ||
"version": "3.2.4", | ||
"description": "Output wrapper is a library to write output file to outputpath.", | ||
@@ -30,4 +30,7 @@ "main": "dist/index.js", | ||
"engines": { | ||
"node": "10.* || >= 12.*" | ||
"node": "^10.12.0 || >= 12.*" | ||
}, | ||
"volta": { | ||
"node": "10.12.0" | ||
} | ||
} |
import * as fs from 'fs'; | ||
import { isAbsolute, resolve } from 'path'; | ||
import { readFileSync, existsSync, readdirSync, lstatSync, statSync, writeFileSync, appendFileSync, mkdirSync, symlinkSync, utimesSync } from 'fs'; | ||
import { removeSync, outputFileSync } from 'fs-extra'; | ||
import { removeSync, outputFileSync, mkdirpSync } from 'fs-extra'; | ||
const symlinkOrCopySync = require('symlink-or-copy').sync; | ||
@@ -54,2 +54,7 @@ | ||
} | ||
case 'mkdirSync': { | ||
if (fsArguments[0] && fsArguments[0].recursive) { | ||
return mkdirpSync(outputPath); | ||
} | ||
} | ||
default: | ||
@@ -89,2 +94,2 @@ return target[propertyName](outputPath, ...fsArguments); | ||
} | ||
} | ||
} |
@@ -41,2 +41,15 @@ const buildOutputWrapper = require('../src'); | ||
it('can create folder recursively', function() { | ||
let SUBFOLDER_PATH = 'main/sub'; | ||
expect(fs.existsSync(`${temp.name}/${SUBFOLDER_PATH}`)).to.be.false; | ||
output.mkdirSync(SUBFOLDER_PATH, { recursive: true }); | ||
expect(fs.existsSync(`${temp.name}/${SUBFOLDER_PATH}`)).to.be.true; | ||
}); | ||
it('can create folder non recursive', function() { | ||
expect(fs.existsSync(`${temp.name}/test`)).to.be.false; | ||
output.mkdirSync('test'); | ||
expect(fs.existsSync(`${temp.name}/test`)).to.be.true; | ||
}); | ||
it('can remove folder recursively', function() { | ||
@@ -43,0 +56,0 @@ output.mkdirSync('test'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50656
11
275