Closed sooraj1002 closed 6 months ago
@sooraj1002 If we do something like this when prisma is selected?
cp .gitignore temp_gitignore
npx prisma init
cp temp_gitignore .gitignore
rm temp_gitignore
// @sooraj1002 @techsavvyash
how will this merge the changes made by npx prisma init
in the .env?
We can do the same process for .env right?
oh sorry, nevermind, I confused between .gitignore
and .env
. Yes for .gitignore
this seems to be the right approach
Prisma version installed by stencil cli prisma : 5.11.0 @prisma/client : 5.11.0
This issue is fixed by prisma way back in the version 3.2.0 Ref: https://github.com/prisma/prisma/pull/8946
Any idea what's causing the issue here then?
There is an issue in the wording of the ticket. What happens is the npx prisma init command runs before our cli is creating the gitignore and the implementation from schematics does not overwrite the created gitignore
An alternative which worked is shown below
Right now when repo is initialized, there is no .gitignore so prisma treats it like no .gitignore so I'll add one
Ref: https://github.com/prisma/prisma/pull/8946
Do not create .gitignore file if already present
So after prisma creates a .gitignore we check if there exists .gitignore, if yes then return as shown in above code If we don't select prisma this condition is false and we can see .gitignore file
This approach looks good @Savio629
Description
When we setup
prisma
, the defaultgitignore
is over-written to just havenode_modules
and.env
This happens because we are running
npx prisma init
for the default setup ofprisma
modelsScreenshots for reference
Current
.gitignore
Expected
.gitignore