Skip to content

Commit

Permalink
preview: send a first preview after exectution of the command
Browse files Browse the repository at this point in the history
With the `preview --live` command we used to wait for some changes on
the target file before launching the preview.

With this PR we generate a first preview with the given file, THEN
wait for future changes on the file.

About bump-sh#182
  • Loading branch information
paulRbr committed May 4, 2023
1 parent b5a43d9 commit 83d33fc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/commands/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ export default class Preview extends Command {
async run(): Promise<void> {
const { args, flags } = this.parse(Preview);

await this.preview(args.FILE, flags.open);
if (flags.live) {
await this.waitForChanges(args.FILE, flags.open);
} else {
await this.preview(args.FILE, flags.open);
}

return;
Expand Down

0 comments on commit 83d33fc

Please sign in to comment.