28
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -6,2 +6,3 @@ 'use strict'; | ||
var _ = require('lodash'); | ||
var Q = require('q'); | ||
var catSettings = require('cat-settings'); | ||
@@ -50,2 +51,3 @@ | ||
} | ||
this.config.expiration_date = session.expiration_date; | ||
this.config.access_token = session.access_token; | ||
@@ -180,2 +182,8 @@ this.config.refresh_token = session.refresh_token; | ||
var that = this; | ||
var exp = new Date(this.config.expiration_date).getTime(); | ||
var now = new Date().getTime(); | ||
if(now + 60 * 60 < exp) { | ||
console.log('API Tokens refreshed.'.grey); | ||
return new Q(); | ||
} | ||
return $28.refreshTokens(this.getEmail(), this.getRefreshToken()).then(function (response) { | ||
@@ -182,0 +190,0 @@ var session = response.body; |
@@ -9,3 +9,3 @@ { | ||
"description": "Command line utility to download and upload 28.io queries.", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"keywords": [ | ||
@@ -12,0 +12,0 @@ "jsoniq", |
@@ -118,2 +118,18 @@ #28.io CLI | ||
### Configure auto-complete | ||
Auto-complete is supported for Mac and Linux. | ||
To enable it in zsh, run: | ||
```bash | ||
echo '. <(28 --completion)' >> .zshrc | ||
``` | ||
To enable it in bash, run: | ||
```bash | ||
28 --completion >> ~/28.completion.sh | ||
echo 'source ~/28.completion.sh' >> .bash_profile | ||
``` | ||
## Settings | ||
@@ -120,0 +136,0 @@ |
173529
1129
163