Skip to content

Commit f79b6b8

Browse files
chore: redo #303 on next
1 parent e97f5d2 commit f79b6b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/parseNameAndPath.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import pathModule from "path";
2+
13
/**
24
* Parses the appName and its path from the user input.
35
* Returns an array of [appName, path] where appName is the name put in the package.json and
@@ -15,7 +17,8 @@ export const parseNameAndPath = (input: string) => {
1517

1618
// If the user ran `npx create-t3-app .` or similar, the appName should be the current directory
1719
if (appName === ".") {
18-
appName = process.cwd().split("/").pop();
20+
const parsedCwd = pathModule.resolve(process.cwd());
21+
appName = pathModule.basename(parsedCwd);
1922
}
2023

2124
// If the first part is a @, it's a scoped package

0 commit comments

Comments
 (0)