Browse Source

Make `login()` return a promise

master
Tony Kovanen 9 years ago
parent
commit
e13f778a5c
  1. 1
      .gitignore
  2. 5
      lib/login.js
  3. 3183
      npm-debug.log
  4. 5
      scripts/post-install.js

1
.gitignore

@ -1,2 +1,3 @@
node_modules node_modules
build build
npm-debug.log

5
lib/login.js

@ -68,10 +68,7 @@ async function register () {
} }
export default function () { export default function () {
register().then((loginData) => { return register().then((loginData) => {
return fs.writeFile(pathJoin(homedir(), '.now.json'), JSON.stringify(loginData)); return fs.writeFile(pathJoin(homedir(), '.now.json'), JSON.stringify(loginData));
}).then(() => {
console.log('> Registration successful. `now` is now ready to use. Your credentials are stored in `~/.now.json`');
process.exit(0);
}); });
} }

3183
npm-debug.log

File diff suppressed because it is too large

5
scripts/post-install.js

@ -1,3 +1,6 @@
import login from '../lib/login'; import login from '../lib/login';
login(); login().then(() => {
console.log('> Logged in successfully. Token saved in ~/.now.json');
process.exit(0);
});

Loading…
Cancel
Save