added relative path in build folder creation

trunk
Kit Swinton 2023-10-20 11:07:22 +11:00
parent 90abf84693
commit 9ba3032a92
1 changed files with 3 additions and 3 deletions

View File

@ -47,14 +47,14 @@ files.forEach( file => {
}); });
fs.cp('./src/styles','./build/styles', { recursive: true }, (err) => { fs.cp('./src/styles','./build/styles', { recursive: true }, (err) => {
if (err) throw err; if (err) throw err;
}); });
function ensureDirectoryExists(filePath) { function ensureDirectoryExists(filePath) {
var dirname = filePath.split('/').slice(0,-1).join('/'); var dirname = filePath.split('/').slice(0,-1).join('/');
if (fs.existsSync(dirname)) { if (fs.existsSync("./" + dirname)) {
return true; return true;
} }
ensureDirectoryExists(dirname); ensureDirectoryExists(dirname);
fs.mkdirSync(dirname); fs.mkdirSync(dirname);