Skip to content

Commit

Permalink
chore: redo #303 on next
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Aug 11, 2022
1 parent e97f5d2 commit f79b6b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/parseNameAndPath.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pathModule from "path";

/**
* Parses the appName and its path from the user input.
* Returns an array of [appName, path] where appName is the name put in the package.json and
Expand All @@ -15,7 +17,8 @@ export const parseNameAndPath = (input: string) => {

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

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

0 comments on commit f79b6b8

Please sign in to comment.