1

是否有任何 nodejs 项目来包装 svn 命令?如:做更新/提交更改。

4

1 回答 1

2

我在 npmjs 上发布了一个名为svn-spawn的项目。

它是 svn 命令的精简包装。

使用示例:

var Client = require('svn-spawn');
var client = new Client({
    cwd: '/path to your svn working directory'
});

// svn up
client.update(function(err, data) {
    console.log('updated');
});

// svn commit
client.commit('commit message here', function(err, data) {
    console.log('done');
});

// any other svn commands
client.cmd(['revert', 'dir1', '--depth', 'infinity'], function(err, data) {
    if (!err) {
        console.log(data);
    }
});
于 2013-07-26T10:27:05.177 回答