Skip to content

Commit

Permalink
fix: projectName for "./" target (#72)
Browse files Browse the repository at this point in the history
* fix: projectName for "./" target

* change testing for current dir to regex
  • Loading branch information
arturgawlik authored Sep 11, 2024
1 parent a60067d commit f233bbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
registerInstallationHook,
} from './hooks/dependencies'

const isCurrentDirRegex = /^(\.\/|\.\\|\.)$/
const directoryName = 'templates'
const config = {
directory: directoryName,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f233bbb

Please sign in to comment.