Skip to content

Commit

Permalink
fix: better checking of hub
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Mar 14, 2022
1 parent c41c43e commit 8c92bfe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/flags/orgFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ const getHubOrThrow = async (aliasOrUsername?: string): Promise<Org> => {
}
}
const org = await Org.create({ aliasOrUsername });
// check the synchronous, cached version and only use "determine" if we didn't get a positive result
if (!org.isDevHubOrg() || !(await org.determineIfDevHubOrg())) {
throw messages.createError('errors.NotADevHub', [aliasOrUsername]);
if (await org.determineIfDevHubOrg()) {
return org;
}
return org;
throw messages.createError('errors.NotADevHub', [aliasOrUsername]);
};

/**
Expand Down

0 comments on commit 8c92bfe

Please sign in to comment.