Skip to content

Commit

Permalink
chore(repo): add colors
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Mar 28, 2022
1 parent 899e681 commit 81b3d0f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion e2e/utils/index.ts
Expand Up @@ -10,6 +10,7 @@ import {
copySync,
createFileSync,
ensureDirSync,
existsSync,
moveSync,
readdirSync,
readFileSync,
Expand All @@ -28,7 +29,15 @@ import chalk = require('chalk');
import isCI = require('is-ci');
import treeKill = require('tree-kill');
import { Workspaces } from '../../packages/nx/src/shared/workspace';
import { detectPackageManager } from '../../packages/create-nx-workspace/bin/package-manager';
import { PackageManager } from 'nx/src/utils/package-manager';

export function detectPackageManager(dir: string = ''): PackageManager {
return existsSync(join(dir, 'yarn.lock'))
? 'yarn'
: existsSync(join(dir, 'pnpm-lock.yaml'))
? 'pnpm'
: 'npm';
}

const kill = require('kill-port');
export const isWindows = require('is-windows');
Expand Down
2 changes: 2 additions & 0 deletions packages/create-nx-workspace/bin/create-nx-workspace.ts
Expand Up @@ -19,6 +19,7 @@ import {
import { validateNpmPackage } from './validate-npm-package';
import { deduceDefaultBase } from './default-base';
import { stringifyCollection } from './utils';
import { yargsDecorator } from './decorator';

type Arguments = {
name: string;
Expand Down Expand Up @@ -190,6 +191,7 @@ export const commandsObject: yargs.Argv<Arguments> = yargs
[getConfiguration]
)
.help('help')
.updateLocale(yargsDecorator)
.version(nxVersion);

async function main(parsedArgs: yargs.Arguments<Arguments>) {
Expand Down
6 changes: 6 additions & 0 deletions packages/create-nx-workspace/bin/decorator.ts
@@ -0,0 +1,6 @@
import * as chalk from 'chalk';

export const yargsDecorator = {
'Options:': `${chalk.green('Options')}:`,
'Positionals:': `${chalk.green('Positionals')}:`,
};

0 comments on commit 81b3d0f

Please sign in to comment.