Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

electron - incremental updating?

I am using electron-vue & electron-packager. I am wondering whether I can do something like incremental updating, that is, after running an electron build command, I don't need to copy the whole electron-linux-x64 folder to my dist machine to update it to the newest, but instead I only need to copy some files in the folder.

Here is what I found up to now: I edit some code for the renderer process. Then I let electron-packager to build a package for linux. Then I find that not all the generated files have been changed. Instead, it seems that only the resources/*.asar have been changed. If I just copy these files to the dist machine, it seems that the machine updates well. But I am not sure whether some hidden files are changed too.

I would appreciate it if anyone could help me!

like image 859
ch271828n Avatar asked Nov 07 '22 18:11

ch271828n


1 Answers

Since there are some upvotes to this question, and after three years I have gained more knowledge let me answer myself, making whoever reads this post can find a solution :)

Firstly, in 2020 there may already have solutions. For instance, try this and this.

Secondly, you can also use rsync to only copy the changed parts in a folder. Moreover, if a big file (say 10GB) only changes a little bit in the middle (say 1MB), it will only transfer that little bit (say 1MB). This is a general tool and can be used everywhere.

Lastly, as a side remark, manually copy your file to the development server is not a good idea. Try to automate this process. The simplest would be a several-line bash script using scp/rsync and so on, and the most complex may be Kubernetes and Docker.

like image 190
ch271828n Avatar answered Nov 15 '22 06:11

ch271828n