create-t3-app icon indicating copy to clipboard operation
create-t3-app copied to clipboard

feat: check for conflicting files

Open AlexanderHott opened this issue 1 year ago • 2 comments

Check for conflicting files

  • [x] I reviewed linter warnings + errors, resolved formatting, types and other issues related to my work
  • [x] The PR title follows the convention we established conventional-commit
  • [-] I performed a functional test on my final commit

It works fine if given a project name, but I couldn't figure out how to test it with . as the name because pnpm start . fails with

> next start "."

'next' is not recognized as an internal or external command,
operable program or batch file.

when inside a test folder.


[Short summary/description of story/feature/bugfix] Checks if existing files will be overwritten and adds the option to overwrite files if there are conflicts.

ℹ project is not empty, but no conflicting files found, continuing...

If there are conflicts

? Warning: project already exists and has conflicting files:

  project\.env-example
  project\.eslintrc.json
  project\next-env.d.ts
  project\next.config.mjs
  project\package.json
  project\public\favicon.ico
  project\README.md
  project\env\client-env.mjs
  project\env\env-schema.mjs
  project\env\server-env.mjs
  project\pages\index.tsx
  project\pages\_app.tsx
  project\styles\globals.css
  project\tsconfig.json
  project\.gitignore

 How would you like to proceed? (Use arrow keys)
❯ Clear directory
  Abort installation
  Overwrite files (dangerous)

Screenshots

[Screenshots] image image

💯

AlexanderHott avatar Jul 22 '22 01:07 AlexanderHott

Fix for #230

AlexanderHott avatar Jul 22 '22 01:07 AlexanderHott

user is in a git repo which is not caught but this logic

The git init should fail but that won't overwrite any files.

edit: formatting

AlexanderHott avatar Jul 25 '22 01:07 AlexanderHott

Closed as inactive

juliusmarminge avatar Aug 25 '22 19:08 juliusmarminge