使用node-rest-client在nodejs中进行多个文件提交

时间:2019-02-18 10:41:21

标签: node.js express gitlab

我使用node-rest-client推送了多个文件gitlab。它适用于单个文件。如果有多个文件,则推送最后一个文件。当迭代并推入数组,然后移动到git中。请查看我的代码和建议需求   var action = [ { "action": "create", "file_path": selfile[i]+"_"+i, "content": base64_encode(selfile[i]), "encoding": "base64" }];         actions.push(action);     }

dataObj = {
    "branch": "master",
    "commit_message": "converted profile",
    "actions":actions,
};
        var Client = require('node-rest-client').Client;
        var client = new Client();           

client.post("https://gitlab.com/api/v1/projects/34/repository/commits",
 args, function (data, response) {
 console.log("true");
});

我如何改善此代码。

0 个答案:

没有答案