mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-24 14:36:41 +07:00
fix some startup problems
This commit is contained in:
parent
969103d111
commit
96fea09b3f
3 changed files with 10 additions and 3 deletions
|
@ -1,12 +1,15 @@
|
|||
# Vk to Telegram bot
|
||||
|
||||
### Configuring
|
||||
|
||||
Copy `config.example.yml` to `config.yml` and set it up.
|
||||
|
||||
#### Running
|
||||
`yarn && yarn build && node ./dist/index.js`
|
||||
|
||||
Setup environment: `yarn environment`, then run the application: `yarn && yarn build && node ./dist/index.js`
|
||||
|
||||
#### Custom arguments
|
||||
|
||||
```bash
|
||||
node ./dist/index.js \
|
||||
--config ./config-dev.yml
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"environment": "docker-compose -f ./docker/docker-compose.yml up db -d",
|
||||
"start": "node ./dist/index.js",
|
||||
"dev": "NODE_ENV=dev node -r ts-node/register ./src/index.ts --config=./config.yml",
|
||||
"build": "rm -rf ./dist && tsc && copyfiles -f ./config*.yml ./dist && copyfiles ./templates/*.md ./dist",
|
||||
|
|
|
@ -30,8 +30,11 @@ export default function prepareConfig() {
|
|||
const key = JSON.parse(
|
||||
fs.readFileSync(config.calendar?.keyFile).toString()
|
||||
) as CalendarKeyFile;
|
||||
calendarKeyValidator.validateSync(key);
|
||||
config.calendarKey = key;
|
||||
|
||||
if (key) {
|
||||
calendarKeyValidator.validateSync(key);
|
||||
config.calendarKey = key;
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("tried to parse calendar key, got error", error);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue