cordova build has erased my files - can they be found

对着背影说爱祢 提交于 2019-12-07 19:27:01

问题


Damn!

I ran cordova build from the CLI for an existing Android app with Eclipse, because another post said to do that if you've got problems with the splashscreen plugin.

Of course, cordova has reset my project to the start and has deleted all my files. Thankfully I've got a copy of the index.html file, but I had a large database initialization file which is now gone.

Is it gone gone? Or has cordova moved it somewhere where it can be retrieved?

(cordova 3.3.0)


回答1:


I would be surprised if Cordova made backups. But as you mention Eclipse the data may still exist as local history: Package Explorer > Context menu for the project > Restore from Local Histoy....




回答2:


While this is not the answer, I figured I would expound on my experience with IntelliJ and the resetting of the project back to stock phonegap app (maybe the reason for this was the same). I once used Eclipse, but since trying IntelliJ I will never use Eclipse again unless required.

Being late at night, I decided to get ramped up on some PhoneGap development. Because that is the best time to learn something, when your brain is frazzled from the work day.

I followed the standard procedure to get a base phonegap project started (using the command line), and did an Import into IntelliJ from existing source. Import went fine, or so I thought.

Being late at night / early in the morning, I went straight to assets/www and started tinkering. Not knowing really much about the phonegap build process yet, I did not realize I was developing out of the android platform assets www folder. I could run my project fine in IntelliJ, changes were showing up in my VM.

But the minute I did a phonegap build android (or cordova build android, whichever), it took everything from my unedited root\www folder and did the build, resetting everything I had done in android platform www folder. Luckily IntelliJ has a local history.

So for now my solution is to add the root\www folder as a source root in IntelliJ and make sure to modify THAT. I probably need to modify my run configurations as well to do a full build / deploy, but I have not got that far yet.



来源:https://stackoverflow.com/questions/21516233/cordova-build-has-erased-my-files-can-they-be-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!