added CI tests
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
import * as plugins from "./smartgit.plugins";
|
||||
import * as helpers from "./smartgit.helpers";
|
||||
|
||||
export let add = (dirPathArg:string) => {
|
||||
let addAll = (dirPathArg:string) => {
|
||||
let done = plugins.Q.defer();
|
||||
if(!helpers.isGitDirectory(dirPathArg)){
|
||||
plugins.beautylog.error("smartgit.add expects a valif git directory!");
|
||||
plugins.beautylog.error("smartgit.add expects a valid git directory!");
|
||||
done.reject();
|
||||
return done.promise;
|
||||
};
|
||||
// if everything is ok proceed
|
||||
plugins.shelljs.exec("");
|
||||
plugins.shelljs.exec(`(cd ${dirPathArg} && git add -A && git status)`);
|
||||
done.resolve(dirPathArg);
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
export let add = {
|
||||
addAll: addAll
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ export let commit = (dirPathArg:string,commitMessage:string) => {
|
||||
return done.promise;
|
||||
};
|
||||
// if everything is all right proceed
|
||||
plugins.shelljs.exec(`git commit -m "${commitMessage}"`);
|
||||
plugins.shelljs.exec(`(cd ${dirPathArg} && git commit -m "${commitMessage}")`);
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
};
|
@ -1,7 +1,12 @@
|
||||
import * as plugins from "./smartgit.plugins";
|
||||
|
||||
export let isGitDirectory = (dirPathArg):boolean => {
|
||||
return plugins.smartfile.fs.isDirectory(
|
||||
plugins.path.join(dirPathArg,".git")
|
||||
);
|
||||
try {
|
||||
return plugins.smartfile.fs.isDirectory(
|
||||
plugins.path.join(dirPathArg,".git")
|
||||
);
|
||||
}
|
||||
catch(err){
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user