-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix spinner and logs collection
- Loading branch information
1 parent
6bfbd43
commit ea91802
Showing
12 changed files
with
59 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
#!/usr/bin/env node | ||
|
||
export default async function(cli, spinner) { | ||
import ora from 'ora'; | ||
|
||
export default async function(cli) { | ||
const spinner = ora().start(); | ||
|
||
const { token, username } = await cli.getCredentials(); | ||
|
||
spinner.text = `Logging out of current session for ${username}`; | ||
|
||
await cli.logout({ token, username }); | ||
await cli.cacheCredentials({ username: '', token: '' }); | ||
|
||
spinner.succeed(`Logged out of session for ${username} successfully`); | ||
spinner.succeed(`Logged out as ${username}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
#!/usr/bin/env node | ||
|
||
export default async function(cli, spinner) { | ||
spinner.text = `Getting logs for ${cli.application}`; | ||
import ora from 'ora'; | ||
|
||
export default async function(cli) { | ||
const spinner = ora().start(); | ||
|
||
spinner.text = `Getting logs for application: "${cli.application}"`; | ||
|
||
const { token, username } = await cli.getCredentials(); | ||
const { logs } = await cli.getLogs({ token, username, name: cli.application }); | ||
|
||
spinner.stop(); | ||
|
||
if(logs) { | ||
console.log('' + // eslint-disable-line | ||
`========== | ||
${logs.join('').trim()} | ||
==========`); | ||
spinner.info(` | ||
========== | ||
${logs.join('').trim()} | ||
========== | ||
`); | ||
} else { | ||
console.log('No logs available 🙈'); // eslint-disable-line | ||
spinner.info('No logs available 🙈'); // eslint-disable-line | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#!/usr/bin/env node | ||
|
||
export default async function(cli, spinner) { | ||
import ora from 'ora'; | ||
|
||
export default async function(cli) { | ||
const spinner = ora().start(); | ||
|
||
spinner.text = 'Figuring out who you are'; | ||
|
||
const { token, username } = await cli.getCredentials(); | ||
const { user } = await cli.getUserDetails({ token, username }); | ||
|
||
spinner.stop(); | ||
|
||
console.log(`currently logged in as ${user.username}`); // eslint-disable-line | ||
spinner.info(`currently logged in as ${user.username}`); // eslint-disable-line | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters