smartgit/ts/smartgit.clone.ts

17 lines
452 B
TypeScript
Raw Normal View History

2016-03-30 23:59:45 +00:00
import plugins = require("./smartgit.plugins");
import SmartgitCheck = require("./smartgit.check");
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();
plugins.smartfile.fs.ensureDir(optionsArg.to);
2016-07-02 00:36:33 +00:00
plugins.shelljs.exec(`git clone ${optionsArg.from} ${optionsArg.to}`);
done.resolve();
2016-03-30 23:59:45 +00:00
return done.promise;
};