mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-01 20:22:29 +00:00
feature(patch) util -> checkup, execon
This commit is contained in:
parent
f157c67756
commit
d03196aa96
1 changed files with 5 additions and 8 deletions
|
|
@ -1,22 +1,19 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
|
||||
var DIR = '../',
|
||||
|
||||
fs = require('fs'),
|
||||
|
||||
Util = require(DIR + 'util'),
|
||||
var fs = require('fs'),
|
||||
|
||||
check = require('checkup'),
|
||||
diff = require('daffy'),
|
||||
|
||||
flop = require('flop'),
|
||||
exec = require('execon'),
|
||||
|
||||
ERROR_MSG = 'File is to big. ' +
|
||||
'Could not patch files ' +
|
||||
'bigger then ';
|
||||
|
||||
module.exports = function(name, patch, options, callback) {
|
||||
Util.check(arguments, ['name', 'patch', 'callback']);
|
||||
check(arguments, ['name', 'patch', 'callback']);
|
||||
|
||||
if (!callback) {
|
||||
callback = options;
|
||||
|
|
@ -44,7 +41,7 @@
|
|||
if (error) {
|
||||
callback(error);
|
||||
} else {
|
||||
error = Util.exec.try(function() {
|
||||
error = exec.try(function() {
|
||||
diffResult = diff.applyPatch(data, patch);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue