WebTemplateStudio icon indicating copy to clipboard operation
WebTemplateStudio copied to clipboard

Infer project name is case insensitive but it should

Open prupipho opened this issue 3 years ago • 1 comments

Describe the bug Depending on the Operative System, the file system is case sensitive and allows to have files with different casing or not having them. Function fs.existsSync doesn´t check this, so when creating a new app with the wizard in Windows, if a folder exists with the name MyApp, the suggested name provided is myApp. Everything seems fine as it validates it correctly, but generation would error because the folder already exists.

To Reproduce Steps to reproduce the behavior:

  1. Create a folder in the destination folder named MyApp.
  2. Open Web Template Studio (Ctrl + Shift + P: Web Template Studio) No matter if Create Web App or Create React Native App.
  3. Notice it still suggests you create an app called myApp.
  4. When you try to generate it will error.

Expected behavior Should recommend the next available name for the app myApp1

Screenshots It shouldn´t suggest an existing folder name. image

Error stack

El nombre de proyecto myApp no es válido. Errores: 
Error: AlreadyExists; Validator: ExistingNamesValidator.)

prupipho avatar May 13 '21 18:05 prupipho

Investigating a bit we didn´t find an easy way to ignore the case with fs.existsSync. There´s a workaround reading the dir, but that´s not efficient and probably not worth at this stage.

prupipho avatar May 24 '21 08:05 prupipho