minor fix to subbg file check
This commit is contained in:
@@ -82,12 +82,14 @@ export const copyResourcesFromGame = async (data: {}) => {
|
|||||||
console.log("Copying new subbg files from gamedata")
|
console.log("Copying new subbg files from gamedata")
|
||||||
let subBGFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg")
|
let subBGFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg")
|
||||||
for await (const subbg of subBGFiles) {
|
for await (const subbg of subBGFiles) {
|
||||||
let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg\\" + subbg.name)
|
if (subbg.name.substring(subbg.name.length-4, subbg.name.length).match(/(\.png|\.jpg)/g)) {
|
||||||
if(!IO.Exists('webui\\asset\\submonitor_bg\\' + subbg.name.substring(0, (subbg.name.length - 4)) + ".png") && !IO.Exists('webui\\asset\\submonitor_bg\\' + subbg.name.substring(0, (subbg.name.length - 4)) + ".jpg")) {
|
let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg\\" + subbg.name)
|
||||||
IO.WriteFile('webui\\asset\\submonitor_bg\\' + subbg.name, fileToWrite)
|
if(!IO.Exists('webui\\asset\\submonitor_bg\\' + subbg.name.substring(0, (subbg.name.length - 4)) + ".png") && !IO.Exists('webui\\asset\\submonitor_bg\\' + subbg.name.substring(0, (subbg.name.length - 4)) + ".jpg")) {
|
||||||
newSubBGData.push(subbg.name)
|
IO.WriteFile('webui\\asset\\submonitor_bg\\' + subbg.name, fileToWrite)
|
||||||
} else {
|
newSubBGData.push(subbg.name)
|
||||||
console.log(subbg.name + " exists")
|
} else {
|
||||||
|
console.log(subbg.name + " exists")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user