mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 14:21:18 +00:00
Fix issue where a fresh install's web UI returns an error because the mods directory does not exist.
This commit is contained in:
parent
a3f062799c
commit
a5560962bc
1 changed files with 2 additions and 0 deletions
|
@ -145,6 +145,7 @@ const getDirSize = (dirPath) => {
|
||||||
|
|
||||||
const getCustomXML = (modId) => {
|
const getCustomXML = (modId) => {
|
||||||
const ret = []
|
const ret = []
|
||||||
|
if (! fs.existsSync(config.modDir)) return ret
|
||||||
for(const file of configFiles) {
|
for(const file of configFiles) {
|
||||||
if (fs.existsSync(config.modDir + d + modId + d + file)) {
|
if (fs.existsSync(config.modDir + d + modId + d + file)) {
|
||||||
ret.push({name:file})
|
ret.push({name:file})
|
||||||
|
@ -166,6 +167,7 @@ const getModNameById = (id) => {
|
||||||
|
|
||||||
const getMods = () => {
|
const getMods = () => {
|
||||||
const mods = []
|
const mods = []
|
||||||
|
if (! fs.existsSync(config.modDir)) return mods
|
||||||
fs.readdirSync(config.modDir).forEach(file => {
|
fs.readdirSync(config.modDir).forEach(file => {
|
||||||
const name = getModNameById(file)
|
const name = getModNameById(file)
|
||||||
mods.push({name:name,id:file})
|
mods.push({name:name,id:file})
|
||||||
|
|
Loading…
Add table
Reference in a new issue