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)