config.json case bugfixe
This commit is contained in:
parent
4301e3003f
commit
092df29869
6
app.js
6
app.js
|
|
@ -6,7 +6,7 @@ const NTFY = require('./lib/ntfy')
|
|||
const Constants = require('./lib/constants')
|
||||
|
||||
new class LottoAutomation {
|
||||
#configFilename = process.env.LOTTO_AUTOMATION_CONFIG_FILENAME ?? 'Config.json'
|
||||
#configFilename = process.env.LOTTO_AUTOMATION_CONFIG_FILENAME ?? 'config.json'
|
||||
#configPath = `${process.env.LOTTO_AUTOMATION_CONFIG_DIR ?? __dirname}/${this.#configFilename}`
|
||||
#config = {}
|
||||
|
||||
|
|
@ -16,14 +16,14 @@ new class LottoAutomation {
|
|||
}
|
||||
#_loadConfig() {
|
||||
if(!Fs.existsSync(this.#configPath))
|
||||
throw new Error('Config.json 파일이 존재하지 않습니다.')
|
||||
throw new Error('config.json 파일이 존재하지 않습니다.')
|
||||
|
||||
try {
|
||||
const configString = Fs.readFileSync(this.#configPath)
|
||||
this.#config = JSON.parse(configString)
|
||||
NTFY.Init(this.#config.ntfyUrl, this.#config.ntfyToken)
|
||||
} catch(e) {
|
||||
throw new Error('Config.json 파일이 올바르지 않습니다.')
|
||||
throw new Error('config.json 파일이 올바르지 않습니다.')
|
||||
}
|
||||
}
|
||||
async #_buyLotto() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue