Skip to content

Commit

Permalink
Fix CLI usage causing a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Aug 15, 2021
1 parent a44fbbd commit fe0b5f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.5.5
*2021-08-15*
- Fixed a crash occurring when using the CLI.

## 1.5.4
*2021-08-15*
- Fixed CLI options not being able to be negated.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linguist-js",
"version": "1.5.4",
"version": "1.5.5",
"description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.",
"main": "dist/index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (const arg in args) {
if (args.analyze) {
(async () => {
const root = args.analyze === true ? '.' : args.analyze;
if (args.ignore[0].match(/(?<!\\)[:;|]/)) args.ignore = args.ignore[0].split(/(?<!\\)[:;|]/);
if (args.ignore?.[0].match(/(?<!\\)[:;|]/)) args.ignore = args.ignore[0].split(/(?<!\\)[:;|]/);
const { count, languages, results } = await linguist(root, args);
if (args.summary) {
const { data, markup, programming, prose, total: { bytes: totalBytes } } = languages;
Expand Down

0 comments on commit fe0b5f3

Please sign in to comment.