From 83d33fc754f67b168f8b73d4377d85b118608a71 Mon Sep 17 00:00:00 2001 From: Paul B Date: Thu, 4 May 2023 17:45:17 +0200 Subject: [PATCH] preview: send a first preview after exectution of the command 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 #182 --- src/commands/preview.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commands/preview.ts b/src/commands/preview.ts index 9b0c6780..bba3edd4 100644 --- a/src/commands/preview.ts +++ b/src/commands/preview.ts @@ -30,10 +30,9 @@ export default class Preview extends Command { async run(): Promise { 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;