From f233bbb21de53ae1b12a2fd9796dd953ace4581c Mon Sep 17 00:00:00 2001 From: Artur Gawlik Date: Wed, 11 Sep 2024 12:49:37 +0200 Subject: [PATCH] fix: projectName for "./" target (#72) * fix: projectName for "./" target * change testing for current dir to regex --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 46942f3..b0c8593 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,7 @@ import { registerInstallationHook, } from './hooks/dependencies' +const isCurrentDirRegex = /^(\.\/|\.\\|\.)$/ const directoryName = 'templates' const config = { directory: directoryName, @@ -106,7 +107,7 @@ async function main( } let projectName = '' - if (target === '.') { + if (isCurrentDirRegex.test(target)) { projectName = path.basename(process.cwd()) } else { projectName = path.basename(target)