Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes checkup run to default to checkup (without run) #404

Merged
merged 2 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ When adding a new breaking change, follow this template in your pull request:
1. Execute Checkup in your project

```shell
checkup run .
checkup .
```

### Running a specific Checkup task in your project

To run a specific task:

```
checkup run --task TASK_NAME
checkup --task TASK_NAME
```

## Running tests
Expand All @@ -100,7 +100,7 @@ yarn test
Checkup using the debug package to provide useful information for debugging. You can enable it by running:

```shell
DEBUG='*' checkup run .
DEBUG='*' checkup
```

## Debugging tests
Expand Down
2 changes: 1 addition & 1 deletion packages/checkup-plugin-ember-octane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ A plugin for CheckupJS that tracks progress of Ember Octane migration tasks.
4. Run checkup.

```sh-session
$ checkup run .
$ checkup
```
8 changes: 4 additions & 4 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ $ checkup generate config
The `checkup` CLI is now available to run. Use the `run` command to run Checkup against your project directory:

```sh-session
$ checkup run .
$ checkup
Checking up on your project...
```

# Run Command
# Checkup Command (alias `checkup run`)

## `checkup run PATH`
## `checkup PATH`

A CLI that provides health check information about your project

```
USAGE
$ checkup run PATH
$ checkup PATH

ARGUMENTS
PATH [default: .] The path referring to the root directory that Checkup will run in
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import { getReporter } from '../reporters';
export default class RunCommand extends Command {
static description = 'Provides health check information about your project';

static usage = '[run] PATH';

static args = [
{
name: 'path',
Expand Down
22 changes: 21 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
export { run } from '@oclif/command';
import { basename, extname, join } from 'path';

import { run as oclifRun } from '@oclif/command';
import { readdirSync } from 'fs';

const DEFAULT_COMMAND = 'run';
const COMMANDS = readdirSync(join(__dirname, 'commands')).map((filename: string) =>
basename(filename, extname(filename))
);

export function run() {
let args = process.argv.slice(2);
let maybeCommand = args[0];

// if the args don't contain a known command, we default to the `run` command
if (!COMMANDS.includes(maybeCommand)) {
args.unshift(DEFAULT_COMMAND);
}

return oclifRun(args);
}