Unverified Commit 3060b867 authored by Isabella Sko艡epov谩's avatar Isabella Sko艡epov谩
Browse files

Its args not opts... 馃寕

parent 48a4ecb3
......@@ -8,9 +8,9 @@ async function readCredentials() {
return JSON.parse(await promisify(fs.readFile)('creds.json', 'utf-8'))
}
async function readChromiumOpts() {
async function readChromiumArgs() {
try {
const data = await promisify(fs.readFile)('chromium-opts.json', 'utf-8')
const data = await promisify(fs.readFile)('chromium-args.json', 'utf-8')
return JSON.parse(data)
} catch (e) {
return undefined
......@@ -26,7 +26,7 @@ console.log('starting')
const args = await Travian.generateArgs({
headless: true,
server: 'https://ts5.travian.cz/',
opts: await readChromiumOpts(),
args: await readChromiumArgs(),
})
const impl = Travian.travianImpl
const travian = impl(...args)
......
......@@ -145,7 +145,7 @@ const generateArgs = async _opts => {
if (!opts.server) throw new Error('You have to specify server')
const browser = await puppeteer.launch({
headless: opts.headless,
opts: opts.opts,
args: opts.args,
})
try {
const page = await browser.newPage()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment