Skip to content

Commit

Permalink
fix fle locating issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Himyu committed Dec 10, 2023
1 parent 098308b commit fb4e030
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docker/entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const onExit = (childProcess) => {
}

const editConfig = async () => {
const file = require('/app/modules/plugin-config/config.json')
const file = require('./modules/plugin-config/config.json')

file.auth = {
enabled: process.env.AUTH !== 'false',
Expand All @@ -38,12 +38,12 @@ const editConfig = async () => {
server: file['plugin-webapi'].server ?? process.env.server
}

await writeJSON('/app/modules/plugin-config/config.json', file, { spaces: 2 })
await writeJSON('modules/plugin-config/config.json', file, { spaces: 2 })
}

const createConfig = async () => {
// Write config file with environment variables
const file = require('/app/modules/plugin-config/config.dist.json')
const file = require('./modules/plugin-config/config.dist.json')
file['plugin-webapi'].apiKey = process.env.RIOT_API_KEY
file['plugin-webapi'].server = process.env.SERVER

Expand All @@ -55,11 +55,11 @@ const createConfig = async () => {
process.env.AUTH !== 'false' ? 'RCVPT-' + uuidAPIKey.create().apiKey : ''
}

await writeJSON('/app/modules/plugin-config/config.json', file, { spaces: 2 })
await writeJSON('modules/plugin-config/config.json', file, { spaces: 2 })
}

const main = async () => {
const checkFile = await exists('/app/modules/plugin-config/config.json')
const checkFile = await exists('modules/plugin-config/config.json')

if (checkFile) {
await editConfig()
Expand Down

0 comments on commit fb4e030

Please sign in to comment.