Skip to content

Commit

Permalink
fix: Show the right message to the user accordingt to used CVS.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelkahomolova committed Oct 21, 2019
1 parent 005b592 commit 188eef6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Command, flags } from '@oclif/command';
import cli from 'cli-ux';
import { ServiceError } from './lib/errors';
import updateNotifier from 'update-notifier';
import { ScanningStrategyDetectorUtils } from './detectors/utils/ScanningStrategyDetectorUtils';
// import { ScanningStrategyDetectorUtils } from './utils/ScanningStrategyDetectorUtils';

class DXScannerCommand extends Command {
static description = 'Scan your project for possible DX recommendations.';
Expand Down Expand Up @@ -46,7 +48,11 @@ class DXScannerCommand extends Command {
await scanner.scan();
} catch (error) {
if (error instanceof ServiceError) {
authorization = await cli.prompt('Insert your GitHub personal access token.\nhttps://github.com/settings/tokens\n');
ScanningStrategyDetectorUtils.isGitHubPath(scanPath)
? (authorization = await cli.prompt('Insert your GitHub personal access token.\nhttps://github.com/settings/tokens\n'))
: (authorization = await cli.prompt(
'Insert your Bitbucket app password.\nhttps://confluence.atlassian.com/bitbucket/app-passwords-828781300.html\n',
));

const container = createRootContainer({ uri: scanPath, auth: authorization, json: json });
const scanner = container.get(Scanner);
Expand Down

0 comments on commit 188eef6

Please sign in to comment.