Skip to content

Commit

Permalink
generateUrl opens browser automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Cámara committed Sep 18, 2017
1 parent e02ac4b commit cd57ca8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const chalk = require('chalk');
const moment = require('moment');
const conf = require('./conf');
const help = require('./help');
const exec = require('child_process').exec;

/**
* Get absolute path
Expand Down Expand Up @@ -71,6 +72,7 @@ const generateUrl = async () => {
scope: conf.SCOPES
});
console.log(authUrl);
exec(`open '${authUrl}'`);
};

/**
Expand Down Expand Up @@ -185,7 +187,7 @@ const insert = async (naturalInfo, options) => {
date: moment(date).format('YYYY-MM-DD')
};
event.end = {
date: duration ?
date: duration ?
moment(date).add(duration.slice(0, -1), duration.slice(-1)).format('YYYY-MM-DD') :
moment(date).add(1, 'd').format('YYYY-MM-DD')
};
Expand All @@ -195,7 +197,7 @@ const insert = async (naturalInfo, options) => {
dateTime: moment(dateTime).format()
};
event.end = {
dateTime: duration ?
dateTime: duration ?
moment(dateTime).add(duration.slice(0, -1), duration.slice(-1)).format() :
moment(dateTime).add(conf.EVENT_DURATION, 'm').format()
};
Expand Down

0 comments on commit cd57ca8

Please sign in to comment.