Skip to content

Commit

Permalink
Fixed env issues
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantasWeng committed Dec 4, 2018
1 parent 565e6ea commit eee7283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions onDuty.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ const { TimeoutError } = require('puppeteer/Errors')
const dateFns = require('date-fns');
const colors = require('colors');

let useEnv = true
let userName = useEnv ? process.env.userName : myConfig.userName
let password = useEnv ? '*'.repeat(process.env.password.length) : myConfig.password
let loginUrl = useEnv ? process.env.loginUrl : myConfig.loginUrl
let userName = process.env.userName
let password = process.env.password
let loginUrl = process.env.loginUrl

program
.version('onDuty.js: Version 0.1.0')
Expand Down Expand Up @@ -44,7 +43,6 @@ program
}

function setConfig (data) {
useEnv = false
userName = data.userName
password = data.password
loginUrl = data.loginUrl
Expand All @@ -54,6 +52,7 @@ const punchDuty = async () => {
console.log(`${colors.yellow('env 目前設定:')}
userName = ${colors.green(userName)}
password = ${colors.green('*'.repeat(password.length))}
password = ${colors.green(password)}
loginUrl = ${colors.green(loginUrl)}
`)
const launchOptions = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onDutyJs",
"version": "1.2.0",
"version": "1.2.1",
"description": "onDuty for tubeHR (Apollo XE)",
"author": "Phantasweng <[email protected]>",
"main": "onDuty.js",
Expand Down

0 comments on commit eee7283

Please sign in to comment.