clone-icode-repo

1.0.0 • Public • Published

clone-icode-repo NPM

clone repo from icode just for developer of baidu, support https and ssh.


Installation

Run npm install clone-icode-repo

Usage

precondition: the access to icode

    var clone = require('clone-icode-repo');
    var url = 'ssh://huangwenming@icode.baidu.com:8235/baidu/animation/mars';
    var dest = './temp';
    clone(url, dest, {type: 'ssh'}, function (err) {
        if (err) {
            console.log('error: ' + err);
        } else {
            console.log('the repo is pulled from icode successfully!');
        }
    });
  • the url parameter (string) is the address of code repository, its structure is: [protocol://] + [username@] + [origin/] + [reponame] + [#branch]

  • the reponame is required, the value of protocol defaults to https.

  • the dest parameter (string) is the file folder to store the pulled code.

  • the third parameter is an object, used to determine which protocol(ssh or https) to use.

  • the fourth parameter is callback for git clone.

Readme

Keywords

Package Sidebar

Install

npm i clone-icode-repo

Weekly Downloads

3

Version

1.0.0

License

ISC

Last publish

Collaborators

  • huangwenming