ember-cli-update: Deletes git ignored files
ember update deletes .env file from the project’s root. This file is not checked into git repo and ignored by .gitignore.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 33 (9 by maintainers)
Still happening. Just lost my
.envfile, IDE local history and everything. Really frustrating. Please, add a warning to the README while this is not fixed.@kellyselden I’ve reproduced the issue in my PC. The problem actually occurs at git-diff-apply.
Steps to reproduce:
.envfile and add it to.gitignore.ember install ember-cli-updateember update..envfile will be missing.What happens:
git-diff-applymakes a git-init like situation where all the files and the directories in current directory become new files and are put in the git index tree.git reset --harddeletes all the files except the ignored files i.e..git,node_modulesand.env. These remaining files become untracked. At this point there’s no.gitignorefile in the current working directory..gitignorefile from the ember blueprint. This file doesn’t have.envin its ignored list.git add -A..envfile is now missing.During the investigation, I created a function like below and called it at various stages of execution:
.envactually gets missing from the moment we checkout back to the master branch.Thank y’all for confirming.
Great job @kellyselden!
Closing 😅…
Just ran ember-cli-update v0.27.3 in 2 separate repos where
.env.deploy.productionusually is deleted. Looks like they are untouched now 👍This happened again… and this time I didn’t backup because it was fixed 😕
In the interest of preventing data loss for additional parties, would it perhaps be best to pull the tool’s recommendation from the blog until this is resolved?
https://www.emberjs.com/blog/2018/10/15/ember-3-5-released.html @MelSumner @jenweber @runspired
@broerse The bug is probably in https://github.com/kellyselden/git-diff-apply, so a failing test case in that test suite would be perfect.
Wow. That’s a great write-up. I’m pretty sure I (or someone else) can make a failing test out of that.