npm login -> npm run login

This commit is contained in:
Ralf Vogler 2021-12-28 20:59:53 +01:00
parent 0394dc3f94
commit 81b04f6f2f
3 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
//@ts-check
const { existsSync } = require('fs');
if (!existsSync('auth.json')) {
console.error('Missing auth.json! Run `npm login` to login and create this file by closing the opened browser.');
console.error('Missing auth.json! Use `npm run login` to login and create this file by closing the opened browser.');
process.exit(1);
}
@ -72,7 +72,7 @@ const newStealthContext = async (browser, contextOptions = {}) => {
await page.goto('https://www.epicgames.com/store/en-US/free-games');
await page.click('button:has-text("Accept All Cookies")'); // to not waste screen space in --debug
if (await page.locator('a[role="button"]:has-text("Sign In")').count() > 0) {
console.error('Not signed in anymore. Run `npm login` to login again.');
console.error('Not signed in anymore. Use `npm run login` to login again.');
process.exit(1);
}
// click on banner to go to current free game. TODO what if there are multiple games?