dojo / dojo/cli

Using "global" cli args in .dojorc file throws

Open
#302 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
27
Forks
30
PR merge metrics
No merged PRs in 30d

Description

**Bug**

There are two "global" command line arguments: `dojorc` and `force`. When one of these is added to the `.dojorc` file they throw an exception.

![image](https://user-images.githubusercontent.com/331431/73865006-d12f6c00-47ff-11ea-9752-602e5feeed68.png)

This happens currently with the .dojorc file

```
{
"create-app": {},
"build-app": {
"dojorc": [ ".dojorc" ]
}
}
```

This is due to how [`getOptions()` checks against aliases](https://github.com/dojo/cli/blob/master/src/registerCommands.ts#L82).

A quick fix for this might be to check `aliases[key]` exists and if it doesn't don't add anything to `config`. A better feature would be to warn when `force` or `dojorc` is used in the `.dojorc` file and quit gracefully.

Package Version: master

**Expected behavior:**

I would expect `dojorc` or `force` in the `.dojorc` file would log a warning to the console and quit.

**Actual behavior:**

An unhandled exception was thrown crashing out of the cli

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.