2016-06-12 14:46:59 +00:00
|
|
|
import "typings-global"
|
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);
|
|
|
|
plugins.shelljs.exec(`cd ${optionsArg.to} && git clone ${optionsArg.from} .`);
|
|
|
|
done.resolve();
|
2016-03-30 23:59:45 +00:00
|
|
|
return done.promise;
|
2016-07-02 00:22:03 +00:00
|
|
|
};
|