Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 563659b

Browse files
author
JSpru
authored
Merge pull request #212 from microsoft/chatdown-show-no-file-contents-error
Show error if no file contents found
2 parents c4289e7 + d8c0b7d commit 563659b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/chatdown/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,22 @@ OPTIONS
2626
2727
-h, --help Chatdown command help
2828
29-
-o, --out=out Path to the directory where the output of the multiple chat file processing (-o) will be
29+
-o, --out=out Path to the directory where the output of the multiple chat file processing (-o) will be
3030
placed.
3131
3232
-p, --prefix Prefix stdout with package name.
3333
3434
-s, --static Use static timestamps when generating timestamps on activities.
3535
36-
EXAMPLE
36+
EXAMPLES
3737
3838
$ bf chatdown
39-
$ bf chatdown --in=./path/to/file/sample.chat
40-
$ bf chatdown --in ./test/utils/*.sample.chat -o ./
39+
$ bf chatdown -h
40+
$ bf chatdown --in ./path/to/file/sample.chat
41+
$ bf chatdown --in ./path/to/file/sample.chat --out ./
42+
$ bf chatdown --in=./path/to/file/sample.chat --out=./
43+
$ bf chatdown -i ./path/to/file/*.sample.chat -o ./
44+
$ bf chatdown -i=./path/to/file/*.sample.chat -o=./
4145
$ (echo user=Joe && [ConversationUpdate=MembersAdded=Joe]) | bf chatdown --static
4246
```
4347

packages/chatdown/src/commands/chatdown.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export default class Chatdown extends Command {
5858
if (typeof writeConfirmation === 'string') {
5959
process.stdout.write(`${chalk.green('Successfully wrote file:')} ${writeConfirmation}\n`)
6060
}
61+
} else if (flags.in && !fileContents) {
62+
throw new CLIError('No file contents found in: ' + flags.in)
6163
} else {
6264
return this._help()
6365
}

0 commit comments

Comments
 (0)