update script to compat windows

This commit is contained in:
王劲鹏 2021-01-20 17:22:26 +08:00 committed by osborn
parent 7570278352
commit 0be7a9679a

View File

@ -39,10 +39,12 @@ function mkdirsSync(dirname) {
allImages.forEach((value) => {
let path = __dirname + '/build/' + value
path = path.split("\\").join("/")
let index = path.lastIndexOf('/')
mkdirsSync(path.substring(0, index))
fs.copyFile(__dirname + '/' + value, __dirname + '/build/' + value, error => {
if (error)
console.log(error)
})
})
@ -55,7 +57,7 @@ function readDirs(dirPath, files) {
})
} else {
for (let bundle of bundles) {
if (dirPath.match(new RegExp(`^${bundle}`))) {
if (dirPath.replace("\\", "/").match(new RegExp(`^${bundle}`))) {
files.push(dirPath)
}
}