WebTemplateStudio
WebTemplateStudio copied to clipboard
Infer project name is case insensitive but it should
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:
- Create a folder in the destination folder named MyApp.
- Open Web Template Studio (
Ctrl + Shift + P:
Web Template Studio) No matter ifCreate Web App
orCreate React Native App
. - Notice it still suggests you create an app called myApp.
- 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.
Error stack
El nombre de proyecto myApp no es válido. Errores:
Error: AlreadyExists; Validator: ExistingNamesValidator.)
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.