Skip to content

Commit

Permalink
feat: add support for alwaysUseAuth in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyumeijie committed Sep 18, 2018
1 parent e60b4f8 commit f3eda1b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function tilde(pathString) {
// The default output directory is the current directory
let outputDirectory = `${process.cwd()}/`;
// Default authentication setting
let authentication = {};
const authentication = {};
let authenticationSwitch = {};
let doesUseAuth = false;
// Defalut configuration file
Expand Down Expand Up @@ -137,9 +137,10 @@ if (!authentication.auth) {
const isExistent = fs.existsSync(configFile);
if (isExistent) {
const data = fs.readFileSync(configFile, 'utf8');
authentication = JSON.parse(data);
const config = JSON.parse(data);
authentication.auth = config.auth;

if (args.alwaysUseAuth) {
if (args.alwaysUseAuth || config.alwaysUseAuth) {
authenticationSwitch = authentication;
doesUseAuth = true;
}
Expand Down

0 comments on commit f3eda1b

Please sign in to comment.