update base structure
This commit is contained in:
11
ts/index.ts
11
ts/index.ts
@ -1,16 +1,9 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
|
||||
import plugins = require("./smartgit.plugins");
|
||||
import SmartgitCheck = require("./smartgit.check");
|
||||
import SmartgitClone = require("./smartgit.clone");
|
||||
export {clone} from "./smartgit.clone";
|
||||
import SmartgitCommit = require("./smartgit.commit");
|
||||
import SmartgitInit = require("./smartgit.init");
|
||||
|
||||
var smartgit:any = {};
|
||||
smartgit.clone = SmartgitClone;
|
||||
smartgit.commit = SmartgitCommit;
|
||||
smartgit.check = SmartgitCheck;
|
||||
smartgit.init = SmartgitInit;
|
||||
|
||||
|
||||
module.exports = smartgit;
|
||||
|
@ -0,0 +1,7 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./smartgit.plugins";
|
||||
|
||||
export let pull = (optionsArg:{path:string,ref?:string}) => {
|
||||
if(!optionsArg.ref) optionsArg.ref = "master";
|
||||
plugins.nodegit.Repository.open(optionsArg.path);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
import plugins = require("./smartgit.plugins");
|
||||
export = function(repoArg) {
|
||||
return true;
|
||||
|
@ -1,14 +1,11 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
import plugins = require("./smartgit.plugins");
|
||||
import SmartgitCheck = require("./smartgit.check");
|
||||
|
||||
export = function(options){
|
||||
export let clone = (options:{from:string,to:string}) => {
|
||||
let done = plugins.Q.defer();
|
||||
/***** URL Checks ******/
|
||||
if (options.from == "undefined" || options.to == "undefined") {
|
||||
plugins.beautylog.error("smartgit.clone".blue + " : Something is strange about the way you invoked the function");
|
||||
return;
|
||||
}
|
||||
//TODO make smartstring URL test
|
||||
|
||||
/***** Path Checks ******/
|
||||
if (!/^\/.*/.test(options.to)){ //check wether path is absolute
|
||||
@ -16,11 +13,21 @@ export = function(options){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
plugins.beautylog.log("Now cloning " + options.from);
|
||||
var cloneOptions:any = {};
|
||||
var cloneRepository = plugins.nodegit.Clone(options.from, options.to, cloneOptions);
|
||||
SmartgitCheck(cloneRepository);
|
||||
done.resolve();
|
||||
var cloneOptions:any = {
|
||||
fetchOpts: {
|
||||
callbacks: {
|
||||
certificateCheck: function() { return 1; },
|
||||
credentials: function(url, userName) {
|
||||
return plugins.nodegit.Cred.sshKeyFromAgent(userName);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var cloneRepository = plugins.nodegit.Clone.clone(options.from, options.to, cloneOptions)
|
||||
.then(() => {
|
||||
SmartgitCheck(cloneRepository);
|
||||
done.resolve();
|
||||
});
|
||||
return done.promise;
|
||||
};
|
@ -1,4 +1,4 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
import plugins = require("./smartgit.plugins");
|
||||
|
||||
export = function(pathArg:string,commitMessage:string) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
import plugins = require("./smartgit.plugins");
|
||||
|
||||
export = function(){
|
||||
|
@ -0,0 +1 @@
|
||||
import "typings-global"
|
@ -1,4 +1,4 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
|
||||
export let path = require("path");
|
||||
export let beautylog = require("beautylog");
|
||||
|
0
ts/smartgit.pull.ts
Normal file
0
ts/smartgit.pull.ts
Normal file
@ -1,7 +0,0 @@
|
||||
{
|
||||
"ambientDependencies": {
|
||||
"colors": "registry:dt/colors#0.6.0-1+20160317120654",
|
||||
"mocha": "registry:dt/mocha#2.2.5+20160317120654",
|
||||
"node": "registry:dt/node#4.0.0+20160330064709"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user