Giter Club home page Giter Club logo

nodediffpatch's Introduction

nodediffpatch

这是一个node命令,有两个命令可用,一是用于生成补丁文件,一个是合并补丁生成新的文件.

很多情况下我们需要生成补丁文件,例如 react native 的热更新,自建服务器进行热更新,不用codepush和pushy,需要生成bundle的补丁文件,然后在手机上合并。

下载操作:

1、打开本地终端,输入 git clone https://github.com/LiuC520/nodediffpatch.git
2、然后输入 cd nodediffpatch && npm i
3、然后输入 sudo npm link ,输入密码后就可以了
4、然后把你要生成的新、旧文件放到nodediffpatch的patch文件夹下,然后就可以用命令生成补丁了,其他语言的源码如下:
源码:我利用的是google的diff文件,下载地址为:https://code.google.com/archive/p/google-diff-match-patch/downloads
但是上面的官方地址需要科学上网,我的网站下载地址:www.vr-react.com/file/diff_match_patch_20121119.zip

命令如下:

下面的 l1.txt 是旧文件,l2.txt 是新文件,只需要换成你自己的就行了

1、patbundle patch -o l1.txt -n l2.txt

           这是生成补丁的命令
           其中l1.txt是你的旧文件,l2.txt是新文件,需要把文件的后缀也带上哦,
           假设你的旧文件为 index.android.bundle,新文件为 new.bundle,
           命令行就是: patbundle patch -o index.android.bundle -n new.bundle

2、patbundle merge -o l1.txt -p patches.pat -n newfile.txt

           也可以简写的哦:patbundle merge -o l1.txt -p patches.pat ,这样的话新的文件名就是 newl1.txt
           也可以简写的哦:patbundle merge -o l1.txt ,这样的话新的文件名就是 newl1.txt,默认的pat文件就是patches.pat
           这就是把l1.txt和pat文件合并成一个新的文件

3、patbundle -h

           查看帮助文档,不知道命令怎么用的,可以查看下哦

nodediffpatch's People

Contributors

liuc520 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.