Skip to content

Commit

Permalink
fix: converted wizard to Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Yegupov committed Jul 31, 2019
1 parent 64667eb commit a50d044
Show file tree
Hide file tree
Showing 12 changed files with 286 additions and 175 deletions.
4 changes: 2 additions & 2 deletions src/cli/commands/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ async function webAuth(via: AuthCliCommands) {
// clear spinnger in case of success or failure
.then(spinner.clear(lbl))
.catch((error) => {
spinner.clear(lbl)();
spinner.clear<void>(lbl)();
throw error;
});
}

async function testAuthComplete(token: string) {
async function testAuthComplete(token: string): Promise<{res; body}> {
const payload = {
body: {
token,
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface BadResult {

// This is used instead of `let x; try { x = await ... } catch { cleanup }` to avoid
// declaring the type of x as possibly undefined.
async function promiseOrCleanup<T>(p: Promise<T>, cleanup: () => void): Promise<T> {
async function promiseOrCleanup<T>(p: Promise<T>, cleanup: (x?) => void): Promise<T> {
return p.catch((error) => { cleanup(); throw error; });
}

Expand Down Expand Up @@ -193,7 +193,7 @@ async function monitor(...args0: MethodArgs): Promise<any> {
const manageUrl = url.format(endpoint);

endpoint.pathname = leader + '/monitor/' + res.id;
const subProjectName = ((inspectResult as MultiDepRootsResult).depRoots)
const subProjectName = isMultiResult(inspectResult)
? depRootDeps.package.name
: undefined;
const monOutput = formatMonitorOutput(
Expand Down
Loading

0 comments on commit a50d044

Please sign in to comment.