update script to compat windows
This commit is contained in:
parent
7570278352
commit
0be7a9679a
@ -39,10 +39,12 @@ function mkdirsSync(dirname) {
|
|||||||
|
|
||||||
allImages.forEach((value) => {
|
allImages.forEach((value) => {
|
||||||
let path = __dirname + '/build/' + value
|
let path = __dirname + '/build/' + value
|
||||||
|
path = path.split("\\").join("/")
|
||||||
let index = path.lastIndexOf('/')
|
let index = path.lastIndexOf('/')
|
||||||
mkdirsSync(path.substring(0, index))
|
mkdirsSync(path.substring(0, index))
|
||||||
|
|
||||||
fs.copyFile(__dirname + '/' + value, __dirname + '/build/' + value, error => {
|
fs.copyFile(__dirname + '/' + value, __dirname + '/build/' + value, error => {
|
||||||
|
if (error)
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -55,7 +57,7 @@ function readDirs(dirPath, files) {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
for (let bundle of bundles) {
|
for (let bundle of bundles) {
|
||||||
if (dirPath.match(new RegExp(`^${bundle}`))) {
|
if (dirPath.replace("\\", "/").match(new RegExp(`^${bundle}`))) {
|
||||||
files.push(dirPath)
|
files.push(dirPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user