From 20ef0cea9bced13560a9a278b579bac99a797d13 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Mon, 14 Aug 2023 00:08:16 +0300 Subject: [PATCH] chore: update logs --- src/file.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/file.ts b/src/file.ts index c06d335..a9176fa 100644 --- a/src/file.ts +++ b/src/file.ts @@ -11,6 +11,10 @@ import { handleErr } from "./utils" const { stat, access, mkdir, readFile, writeFile } = fs export async function createDirIfNotExists(dir: string, config: ScaffoldConfig): Promise { + if (config.dryRun) { + log(config, LogLevel.Info, `Dry Run. Not creating dir ${dir}`) + return + } const parentDir = path.dirname(dir) if (!(await pathExists(parentDir))) { @@ -147,7 +151,7 @@ export async function copyFileTransformed( log(config, LogLevel.Info, "Done.") } else { log(config, LogLevel.Info, "Dry Run. Output should be:") - log(config, LogLevel.Info, finalOutputContents) + log(config, LogLevel.Info, finalOutputContents.toString()) } } else if (exists) { log(config, LogLevel.Info, `File ${outputPath} already exists, skipping`)