Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 130 forks source link

graphcool init overwrites existing package.json #354

Open marktani opened 6 years ago

marktani commented 6 years ago

Issue by schickling Wednesday Nov 01, 2017 at 15:34 GMT Originally opened as https://github.com/graphcool/prisma/issues/1103


From @wesbos on October 27, 2017 14:7

running graphcool init just blew away my existing package.json - it should check if there is already a package.json

Copied from original issue: graphcool/graphql-cli#41

marktani commented 6 years ago

Comment by kbrandwijk Saturday Nov 11, 2017 at 21:14 GMT


Proposal: warn for any existing file on init, in line with the recommendation to initialize a Graphcool service project in an empty folder.

jesstelford commented 6 years ago

Just got bitten by this and lost some unsaved changes. Thankfully could do a partial restore due to some console output.

In general, I think any writes should guard against overwriting any data that exists. At the very least, it should prompt, preferably it would do a merge of some kind.