mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-16 04:45:34 +00:00
ensure folders exist
This commit is contained in:
parent
5ad961d218
commit
a52d42538a
@ -36,16 +36,21 @@ async function downloadGC(branch) {
|
|||||||
|
|
||||||
const serverFolderFixed = config.serverFolder.match(/.*\\|.*\//g, '')[0].replace(/\//g, '\\')
|
const serverFolderFixed = config.serverFolder.match(/.*\\|.*\//g, '')[0].replace(/\//g, '\\')
|
||||||
|
|
||||||
|
// Ensure data and key folders exist
|
||||||
|
|
||||||
|
await Neutralino.os.execCommand(`mkdir ${serverFolderFixed}\\data`)
|
||||||
|
await Neutralino.os.execCommand(`mkdir ${serverFolderFixed}\\keys`)
|
||||||
|
|
||||||
// Download data files
|
// Download data files
|
||||||
for (const o of dataList) {
|
for (const o of dataList) {
|
||||||
const folder = 'data'
|
const folder = 'data'
|
||||||
Neutralino.os.execCommand(`powershell Invoke-WebRequest -Uri ${o.url} -OutFile "${serverFolderFixed}\\${folder}\\${o.filename}"`)
|
await Neutralino.os.execCommand(`powershell Invoke-WebRequest -Uri ${o.url} -OutFile "${serverFolderFixed}\\${folder}\\${o.filename}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download each file
|
// Download key files
|
||||||
for (const o of keyList) {
|
for (const o of keyList) {
|
||||||
const folder = 'keys'
|
const folder = 'keys'
|
||||||
Neutralino.os.execCommand(`powershell Invoke-WebRequest -Uri ${o.url} -OutFile "${serverFolderFixed}\\${folder}\\${o.filename}"`)
|
await Neutralino.os.execCommand(`powershell Invoke-WebRequest -Uri ${o.url} -OutFile "${serverFolderFixed}\\${folder}\\${o.filename}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user