how to bundle git with an electron app

馋奶兔 提交于 2019-12-11 05:07:37

问题


I am developing an electron application for a client and they need an easy way to update the app as I work on it. I have found that the easiest way is to just include support for pulling from a git repo and this works fine in my tests and on the clients' machine.

Recently, they tried to install the app on a new mac that does not have git installed. The client, who is not tech savvy, is having a lot of trouble installing git and it took me a while to walk them through downloading the installer, clicking on it, running it etc. To avoid this in the future, I'd like to just bundle git in my electron application and use a local copy. Is this possible/doable/desirable? Are there any other good ways to approach this problem?


回答1:


I'd recommend you to build installers instead of your git solution. electron has support for automatic updates (windows/mac) and electron-builder creates installers for you (with autoUpdates enabled). This should be way less painful and more stable.

Then, if you still need to bundle 3rd party stuff w/ your app see How to bundle a third party binary with Electron? and other answers on SO.

If you provided some more details I could give you a tailored answer (OS, private app just for your client?, ...).



来源:https://stackoverflow.com/questions/40104523/how-to-bundle-git-with-an-electron-app

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