UNPKG

watch-xdelta

Version:

smart-watch xdelta script

27 lines (22 loc) 933 B
#!/usr/bin/env node 'use strict'; import child_process from 'child_process'; import fs from 'fs'; import babel from 'babel'; import bfs from 'babel-fs'; import co from 'co'; import program from 'commander'; import ss from 'stream-stream'; import xdelta from './main'; program .version('1.9.0') .usage('wxdelta [-s] <oldFile> <newFile>') .option('-s, --size [size]', 'the size to slice two files, default is 64k', 64) .option('-c, --clean', 'clean up processing files, only keep the delta file') .option('-1, --software [version]', 'the software version, default is 00000000', 0) .option('-2, --hardware [version]', 'the hardware version, default is 00000000', 0) .parse(process.argv); const [oldPath, newPath] = program.args; co(function *(){ yield xdelta({oldPath: oldPath, newPath: newPath, diffPath: 'xdeltatotalheader.bin', size: program.size, hwVersion: program.software, swVersion: program.hardware});; });