Skip to content

Commit

Permalink
format Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
WindomZ committed Nov 5, 2017
1 parent 6a76a46 commit b36fdb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions bin/boomer
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ program
.action((argv, opts) => {
const app = boomer(argv.phone || process.env.PHONE || '13800000000', {
once: !opts.forever,
isProduction: !opts.dev
isProduction: !opts.dev,
});

app
Expand All @@ -23,7 +23,9 @@ program
})
.on('next', currentTarget => {
utils.info(
`进入到 ${chalk.green(currentTarget.name)} ${chalk.green.underline(currentTarget.url)}`
`进入到 ${chalk.green(currentTarget.name)} ${chalk.green.underline(
currentTarget.url
)}`
);
})
.on('error', err => {
Expand Down
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ if (checkIsChromiumExist() === false) {
)}`
);
console.error(
`Try to reinstall: ${chalk.green('node ' + path.join(config.paths.puppeteer, 'install.js'))}`
`Try to reinstall: ${chalk.green(
'node ' + path.join(config.paths.puppeteer, 'install.js')
)}`
);
process.exit(1);
}
Expand All @@ -46,14 +48,16 @@ const defaultOptions = {
name: '张大爷',
password: 'abc123abc123',
phone: '13000000000', // do not set default phone number
once: isProduction === false
once: isProduction === false,
};

module.exports = function(phoneNumber, options) {
if (typeof phoneNumber !== 'string' && !isNaN(+phoneNumber)) {
throw new Error(`Invalid phone number ${phoneNumber}`);
}
const app = new App(Object.assign({}, defaultOptions, options, { phone: phoneNumber }));
const app = new App(
Object.assign({}, defaultOptions, options, { phone: phoneNumber })
);
process.on('exit', () => {
app.close();
});
Expand Down

0 comments on commit b36fdb3

Please sign in to comment.