2016-03-30 23:59:45 +00:00
|
|
|
import plugins = require("./smartgit.plugins");
|
|
|
|
import SmartgitCheck = require("./smartgit.check");
|
|
|
|
|
2016-07-02 00:22:03 +00:00
|
|
|
export let clone = (optionsArg: {
|
|
|
|
from: string,
|
|
|
|
to: string,
|
|
|
|
key?: string,
|
|
|
|
keyPath?: string,
|
|
|
|
keyPassphrase?: string
|
|
|
|
}) => {
|
2016-03-30 23:59:45 +00:00
|
|
|
let done = plugins.Q.defer();
|
2016-07-02 00:22:03 +00:00
|
|
|
plugins.smartfile.fs.ensureDir(optionsArg.to);
|
2016-07-02 00:36:33 +00:00
|
|
|
plugins.shelljs.exec(`git clone ${optionsArg.from} ${optionsArg.to}`);
|
2016-07-02 00:22:03 +00:00
|
|
|
done.resolve();
|
2016-03-30 23:59:45 +00:00
|
|
|
return done.promise;
|
2016-07-02 00:22:03 +00:00
|
|
|
};
|