Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Isabella Skořepová
travian
Commits
3060b867
Unverified
Commit
3060b867
authored
Sep 17, 2017
by
Isabella Skořepová
Browse files
Its args not opts...
🌂
parent
48a4ecb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
3060b867
...
...
@@ -8,9 +8,9 @@ async function readCredentials() {
return
JSON
.
parse
(
await
promisify
(
fs
.
readFile
)(
'
creds.json
'
,
'
utf-8
'
))
}
async
function
readChromium
Opt
s
()
{
async
function
readChromium
Arg
s
()
{
try
{
const
data
=
await
promisify
(
fs
.
readFile
)(
'
chromium-
opt
s.json
'
,
'
utf-8
'
)
const
data
=
await
promisify
(
fs
.
readFile
)(
'
chromium-
arg
s.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/
'
,
opt
s
:
await
readChromium
Opt
s
(),
arg
s
:
await
readChromium
Arg
s
(),
})
const
impl
=
Travian
.
travianImpl
const
travian
=
impl
(...
args
)
...
...
src/travian.js
View file @
3060b867
...
...
@@ -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
,
opt
s
:
opts
.
opt
s
,
arg
s
:
opts
.
arg
s
,
})
try
{
const
page
=
await
browser
.
newPage
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment