mirror of
https://git.mapside.kr/public/lotto_automation.git
synced 2026-09-20 16:05:02 +09:00
config.json case bugfixe
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user