From 3de1f81eb1f23aa2cb41ff6a419fc2b232c04e6f Mon Sep 17 00:00:00 2001 From: Jef LeCompte Date: Sun, 20 Sep 2020 10:39:44 -0400 Subject: [PATCH] hotfix: make `HEADLESS` default `true` Signed-off-by: Jef LeCompte --- .env-example | 4 ++-- README.md | 4 ++-- src/config.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env-example b/.env-example index 939a35b..a542141 100644 --- a/.env-example +++ b/.env-example @@ -1,5 +1,7 @@ EMAIL_USERNAME="youremail@gmail.com" EMAIL_PASSWORD="secretpassword" +HEADLESS="true" +LOG_LEVEL="info" NOTIFICATION_TEST="false" OPEN_BROWSER="true" PAGE_TIMEOUT="30000" @@ -16,5 +18,3 @@ STORES="bestbuy,bandh,nvidia" SCREENSHOT="true" TELEGRAM_ACCESS_TOKEN="" TELEGRAM_CHAT_ID="1234" -HEADLESS="true" -LOG_LEVEL="info" \ No newline at end of file diff --git a/README.md b/README.md index 9270593..66afb49 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ Here is a list of variables that you can use to customize your newly copied `.en |:---:|---|---| | `EMAIL_USERNAME` | Gmail address | E.g.: `jensen.robbed.us@gmail.com` | | `EMAIL_PASSWORD` | Gmail password | See below if you have MFA | -| `HEADLESS` | Puppeteer to run headless or not (Debugging Purposes) | -| `LOG_LEVEL` | [Logging levels](https://github.com/winstonjs/winston#logging-levels) (Debugging Purposes) | +| `HEADLESS` | Puppeteer to run headless or not | Debugging related, default: `true` | +| `LOG_LEVEL` | [Logging levels](https://github.com/winstonjs/winston#logging-levels) | Debugging related, default: `info` | | `NOTIFICATION_TEST` | Test all the notifications configured | Default: `false` | | `OPEN_BROWSER` | Toggle for whether or not the browser should open when item is found | Default: `true` | | `PAGE_TIMEOUT` | Navigation Timeout in milliseconds | `0` for infinite, default: `30000` | diff --git a/src/config.ts b/src/config.ts index 9c138ac..1207810 100644 --- a/src/config.ts +++ b/src/config.ts @@ -51,7 +51,7 @@ const stores = process.env.STORES ? process.env.STORES.split(',') : ['nvidia']; const openBrowser = process.env.OPEN_BROWSER === 'true'; -const isHeadless = process.env.HEADLESS === 'true'; +const isHeadless = process.env.HEADLESS ? process.env.HEADLESS === 'true' : true; const showOnlyBrands = process.env.SHOW_ONLY_BRANDS ? process.env.SHOW_ONLY_BRANDS.split(',') : [];