This repository has been archived by the owner on Jan 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'autoComplete' of https://github.com/HAECHI-LABS/henesis…
…-cli into autoComplete
- Loading branch information
Showing
13 changed files
with
231 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
const os = require("os"); | ||
require('os'); | ||
|
||
if (os.type() === "Windows_NT") { | ||
const exec = require('child_process').exec; | ||
exec('%cd%/bin/setup.cmd', function callback(error, stdout, stderr){ | ||
}); | ||
if (os.type() === 'Windows_NT') { | ||
const exec = require('child_process').exec; | ||
exec('%cd%/bin/setup.cmd', function callback(error, stdout, stderr) {}); | ||
} else { | ||
const exec = require('child_process').exec; | ||
exec('sh ./bin/setup', function callback(error, stdout, stderr){ | ||
}); | ||
} | ||
const exec = require('child_process').exec; | ||
exec('sh ./bin/setup', function callback(error, stdout, stderr) {}); | ||
} |
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
12 changes: 6 additions & 6 deletions
12
src/commands/changepw.ts → src/commands/account/changepw.ts
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { expect, test } from '@oclif/test'; | ||
import * as utils from '../../utils'; | ||
import configstore from '../../common/configstore'; | ||
import { Scope } from 'nock'; | ||
|
||
describe('account:describe', (): void => { | ||
context( | ||
'error occurred cases', | ||
async (): Promise<void> => { | ||
test | ||
.stdout() | ||
.command(['account:describe']) | ||
.exit(2) | ||
.it('should be fail not logged in'); | ||
}, | ||
); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import userRpc from '../../rpc/user'; | ||
import Command from '../../common/base'; | ||
import configstore from '../../common/configstore'; | ||
|
||
export default class Describe extends Command { | ||
public static description = 'describe account information'; | ||
|
||
public static examples = [`$ henesis account:describe`]; | ||
|
||
public static flags = {}; | ||
|
||
public static args = []; | ||
|
||
public async run(): Promise<void> { | ||
const user = configstore.get('user'); | ||
if (!user) { | ||
this.error('You are not logged in.'); | ||
//TODO: Enhancement: redirect to login prompt | ||
} | ||
|
||
try { | ||
const userResponse = await userRpc.describe(); | ||
this.log(`Email: ${userResponse.email}`); | ||
this.log(`Name: ${userResponse.name}`); | ||
this.log(`Organization: ${userResponse.organization}`); | ||
this.log(`clientId: ${userResponse.clientId}`); | ||
} catch (err) { | ||
this.error(err.message); | ||
} | ||
} | ||
} |
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,5 +1,6 @@ | ||
export { | ||
newMockLogin, | ||
newMockAccount, | ||
newMockIntegration, | ||
newMockIntegrationSpec, | ||
} from './factory'; |
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
Oops, something went wrong.