Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
c2105ce78f | |||
2864fc5507 | |||
fea523ff5c | |||
872f2354c5 | |||
ff0318534f | |||
e103074684 | |||
f72beabd90 | |||
958a625633 | |||
871fd55c5c | |||
07fd9b9fa7 | |||
62d6a8d685 | |||
047cf02e6a | |||
69127cacdd | |||
7529098a50 | |||
15c331690b | |||
29d176bafa | |||
8763926288 | |||
da16094e36 | |||
5fd2b07266 | |||
6618463e0a | |||
93af3cd0e1 | |||
854598ab25 | |||
dffc390637 | |||
ae5b6b5afd | |||
c7f87eebae | |||
63c54ff790 | |||
7670698e84 | |||
7e2481d511 | |||
9ae3acb3d8 | |||
4e12b7ee3b | |||
e07f5717c8 | |||
e0daf85e34 |
30
.gitignore
vendored
30
.gitignore
vendored
@ -1,14 +1,22 @@
|
|||||||
node_modules/
|
.nogit/
|
||||||
.settings/
|
|
||||||
.idea/
|
# artifacts
|
||||||
test/temp/
|
|
||||||
test/temp2/
|
|
||||||
coverage/
|
coverage/
|
||||||
docs/
|
public/
|
||||||
|
pages/
|
||||||
|
|
||||||
#npm devug
|
# installs
|
||||||
npm-debug.log
|
node_modules/
|
||||||
|
|
||||||
ts/*.js
|
# caches
|
||||||
ts/*.js.map
|
.yarn/
|
||||||
ts/typings/
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
|
# custom
|
106
.gitlab-ci.yml
106
.gitlab-ci.yml
@ -1,49 +1,105 @@
|
|||||||
image: hosttoday/ht-docker-node:npmts
|
# gitzone ci_default
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .npmci_cache/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- trigger
|
- metadata
|
||||||
|
|
||||||
before_script:
|
# ====================
|
||||||
- npmci prepare ssh
|
# security stage
|
||||||
|
# ====================
|
||||||
testLEGACY:
|
mirror:
|
||||||
stage: test
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci test legacy
|
- npmci git mirror
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
- notpriv
|
||||||
|
|
||||||
|
snyk:
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install -g snyk
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command snyk test
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# test stage
|
||||||
|
# ====================
|
||||||
|
|
||||||
testLTS:
|
testLTS:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test lts
|
- npmci npm prepare
|
||||||
|
- npmci node install lts
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
testSTABLE:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci test stable
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci publish
|
- npmci node install lts
|
||||||
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# metadata stage
|
||||||
|
# ====================
|
||||||
|
codequality:
|
||||||
|
stage: metadata
|
||||||
|
allow_failure: true
|
||||||
|
script:
|
||||||
|
- npmci command npm install -g tslint typescript
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: trigger
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
stage: metadata
|
||||||
|
script:
|
||||||
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
19
.travis.yml
19
.travis.yml
@ -1,19 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- 4
|
|
||||||
- stable
|
|
||||||
before_install:
|
|
||||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
|
||||||
- sudo apt-get update
|
|
||||||
- sudo apt-get install libstdc++-4.9-dev -y
|
|
||||||
deploy:
|
|
||||||
provider: npm
|
|
||||||
email: npm@lossless.digital
|
|
||||||
api_key:
|
|
||||||
secure: o/3H4keWRAvHZaJnUN9UX+hqu+prKGtBsOEWVIaRXUpf6nIHIDm9zlJrS5cv2VUseOZqLAOkzeGYPqlOJlxccy5frKEYMhtCY97BjKvUOf01roL82OGiahw5Bv04NcaBoSepCliyyXihlgZO/5tSoR1seY4ycul2qWLktaEmh8HcTPjem8gB49Svpfk8yPKLpq6cv/sSakt2X24Cq+vfdxYiz7GcgBfv3EVAndUmQ9KMQfkSbq8XgYEZKrLi5kdpXX0y1LRdsbn2rwuMwLOmefCenmQSuBCbYmbOxPgVHHHjVm9To/rhx8YHBCcZSH9go2pdDLwrd7VPOCK+vMHCz/rlASwVM/BGr+aJHCFLAyovrIU7cvbbjLPOUjto6xY2XckMmDBD1YDxYnAJAON1QrdXE9hVVRfMNfaC2leFAwhla1WMok5DcEv+/Q9cUXQCBGQHtBhkhmCCt54ERLFnjXCDZr1icR/0lhtQY54hin5jSHqnU2hTZtTpQX7sF0yZM2sbhTBpV5FTDAGH/ohNWSEnTwAXmL9iwZCTvtWUbBeOUSDRj8BLS54uiaIcIVytNY0p2PdnhwJAWO+4FGjSOT+RuK8RiKzyVXjPiX8TCzaOqBFs947m8SSNMSt6zyqOI27gOSzU7szgsKY769Fl+X9sdzFXaSa72rj4EdvgiBA=
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
repo: pushrocks/smartgit
|
|
||||||
notifications:
|
|
||||||
slack:
|
|
||||||
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=
|
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 Push.Rocks
|
Copyright (c) 2015 Lossless GmbH
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
83
README.md
83
README.md
@ -1,17 +1,76 @@
|
|||||||
# smartgit is an easy wrapper for nodegit
|
# @pushrocks/smartgit
|
||||||
a wrapper for git. This plugin does not use nodegit as nodegit appears to have too many bugs for now.
|
smart wrapper for nodegit
|
||||||
|
|
||||||
### Buildstatus/Dependencies
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartgit)
|
||||||
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartgit)
|
||||||
|
* [github.com (source mirror)](https://github.com/pushrocks/smartgit)
|
||||||
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartgit/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/smartgit/commits/master)
|
[](https://gitlab.com/pushrocks/smartgit/commits/master)
|
||||||
[](https://david-dm.org/pushrocks/smartgit#info=devDependencies)
|
[](https://gitlab.com/pushrocks/smartgit/commits/master)
|
||||||
[](https://coveralls.io/github/pushrocks/smartgit?branch=master)
|
[](https://www.npmjs.com/package/@pushrocks/smartgit)
|
||||||
|
[](https://snyk.io/test/npm/@pushrocks/smartgit)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://prettier.io/)
|
||||||
|
|
||||||
### Usage
|
## Usage
|
||||||
This plugin exposes some easified method wrappers for nodegit.
|
|
||||||
This limits options but reduces errors (TypeScript) and speeds up usage.
|
|
||||||
|
|
||||||
Features:
|
We recommend the use of TypeScript for best in class intellisense
|
||||||
|
|
||||||
* easily clone a git repo
|
```javascript
|
||||||
* easily create a new git repo
|
// import smartgit:
|
||||||
* easily add all changes and make a new commit
|
import { GitRepo } from 'smartgit';
|
||||||
|
|
||||||
|
// Initialize smartgit:
|
||||||
|
// -- note: there are 3 ways to initialize smartgit
|
||||||
|
// -- -- 1. with a existing Git repo
|
||||||
|
// -- -- 2. with a cloned Git repo
|
||||||
|
// -- -- 3. with a new Git repo
|
||||||
|
|
||||||
|
// -- 1. existing Git Repo:
|
||||||
|
let myExistingGitRepo = new GitRepo('/path/to/existing/git/repo/');
|
||||||
|
|
||||||
|
// -- 2. cloned Git Repo:
|
||||||
|
let myClonedGitRepo: GitRepo;
|
||||||
|
smartgit.createRepoFromClone('git@github.com:username/reponame.git').then(gitRepo => {
|
||||||
|
// non blocking
|
||||||
|
myClonedGitRepo = gitRepo;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -- 3. new Git Repo
|
||||||
|
let myNewGitRepo: GitRepo;
|
||||||
|
smartgit
|
||||||
|
.createRepoFromInit('/path/to/new/folder') // smartgit will create any new folder, be careful
|
||||||
|
.then(gitRepo => {
|
||||||
|
// non blocking
|
||||||
|
myNewGitRepo = gitRepo;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Using smartgit instance
|
||||||
|
// -- most used actions
|
||||||
|
// -- all actions return promises, so make sure to use promise chaining for any dependent tasks
|
||||||
|
myExistingGitRepo.addAll(); // returns promise, stages all changed files
|
||||||
|
myExistingGitRepo.add(['relative/path/to/file.txt', 'another/file2.txt']); // returns promise, stages specific files
|
||||||
|
myExistingGitRepo.commit('my commit message'); // returns promise, commits staged files
|
||||||
|
myExistingGitRepo
|
||||||
|
.status() // returns promise
|
||||||
|
.then(status => {
|
||||||
|
// Use TypeScript for status type information
|
||||||
|
});
|
||||||
|
myExistingGitRepo.check(); // returns promise, checks repo health
|
||||||
|
myExistingGitRepo.remoteAdd('git@github.com:username/reponame.git');
|
||||||
|
```
|
||||||
|
|
||||||
|
Tip: use [smartssh](https://npmjs.com/smartssh) to setup your SSH environment
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://maintainedby.lossless.com)
|
||||||
|
7
dist/index.d.ts
vendored
7
dist/index.d.ts
vendored
@ -1,7 +0,0 @@
|
|||||||
export { add } from "./smartgit.add";
|
|
||||||
export { clone } from "./smartgit.clone";
|
|
||||||
export { commit } from "./smartgit.commit";
|
|
||||||
export { init } from "./smartgit.init";
|
|
||||||
export { pull } from "./smartgit.pull";
|
|
||||||
export { push } from "./smartgit.push";
|
|
||||||
export { remote } from "./smartgit.remote";
|
|
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -1,16 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var smartgit_add_1 = require("./smartgit.add");
|
|
||||||
exports.add = smartgit_add_1.add;
|
|
||||||
var smartgit_clone_1 = require("./smartgit.clone");
|
|
||||||
exports.clone = smartgit_clone_1.clone;
|
|
||||||
var smartgit_commit_1 = require("./smartgit.commit");
|
|
||||||
exports.commit = smartgit_commit_1.commit;
|
|
||||||
var smartgit_init_1 = require("./smartgit.init");
|
|
||||||
exports.init = smartgit_init_1.init;
|
|
||||||
var smartgit_pull_1 = require("./smartgit.pull");
|
|
||||||
exports.pull = smartgit_pull_1.pull;
|
|
||||||
var smartgit_push_1 = require("./smartgit.push");
|
|
||||||
exports.push = smartgit_push_1.push;
|
|
||||||
var smartgit_remote_1 = require("./smartgit.remote");
|
|
||||||
exports.remote = smartgit_remote_1.remote;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsNkJBQWtCLGdCQUFnQixDQUFDO0FBQTNCLGlDQUEyQjtBQUNuQywrQkFBb0Isa0JBQWtCLENBQUM7QUFBL0IsdUNBQStCO0FBQ3ZDLGdDQUFxQixtQkFBbUIsQ0FBQztBQUFqQywwQ0FBaUM7QUFDekMsOEJBQW1CLGlCQUFpQixDQUFDO0FBQTdCLG9DQUE2QjtBQUNyQyw4QkFBbUIsaUJBQWlCLENBQUM7QUFBN0Isb0NBQTZCO0FBQ3JDLDhCQUFtQixpQkFBaUIsQ0FBQztBQUE3QixvQ0FBNkI7QUFDckMsZ0NBQXFCLG1CQUFtQixDQUFDO0FBQWpDLDBDQUFpQyJ9
|
|
0
dist/postinstall.d.ts
vendored
0
dist/postinstall.d.ts
vendored
3
dist/postinstall.js
vendored
3
dist/postinstall.js
vendored
@ -1,3 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var shelljs = require("shelljs");
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9zdGluc3RhbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wb3N0aW5zdGFsbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDIn0=
|
|
1
dist/smartgit.add.d.ts
vendored
1
dist/smartgit.add.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let add: (dirPathArg: string) => any;
|
|
17
dist/smartgit.add.js
vendored
17
dist/smartgit.add.js
vendored
@ -1,17 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
var helpers = require("./smartgit.helpers");
|
|
||||||
exports.add = function (dirPathArg) {
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
if (!helpers.isGitDirectory(dirPathArg)) {
|
|
||||||
plugins.beautylog.error("smartgit.add expects a valif git directory!");
|
|
||||||
done.reject();
|
|
||||||
return done.promise;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
// if everything is ok proceed
|
|
||||||
plugins.shelljs.exec("");
|
|
||||||
done.resolve(dirPathArg);
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuYWRkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuYWRkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBQzlDLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFbkMsV0FBRyxHQUFHLFVBQUMsVUFBaUI7SUFDL0IsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLDZDQUE2QyxDQUFDLENBQUM7UUFDdkUsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDO1FBQ2QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDeEIsQ0FBQztJQUFBLENBQUM7SUFDRiw4QkFBOEI7SUFDOUIsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDekIsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUN6QixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ==
|
|
2
dist/smartgit.check.d.ts
vendored
2
dist/smartgit.check.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
declare var _default: (repoArg: any) => boolean;
|
|
||||||
export = _default;
|
|
5
dist/smartgit.check.js
vendored
5
dist/smartgit.check.js
vendored
@ -1,5 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
module.exports = function (repoArg) {
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY2hlY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGdpdC5jaGVjay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsaUJBQVMsVUFBUyxPQUFPO0lBQ3JCLE1BQU0sQ0FBQyxJQUFJLENBQUM7QUFDaEIsQ0FBQyxDQUFDIn0=
|
|
7
dist/smartgit.clone.d.ts
vendored
7
dist/smartgit.clone.d.ts
vendored
@ -1,7 +0,0 @@
|
|||||||
export declare let clone: (optionsArg: {
|
|
||||||
from: string;
|
|
||||||
to: string;
|
|
||||||
key?: string;
|
|
||||||
keyPath?: string;
|
|
||||||
keyPassphrase?: string;
|
|
||||||
}) => any;
|
|
10
dist/smartgit.clone.js
vendored
10
dist/smartgit.clone.js
vendored
@ -1,10 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
exports.clone = function (optionsArg) {
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
plugins.smartfile.fs.ensureDir(optionsArg.to);
|
|
||||||
plugins.shelljs.exec("git clone " + optionsArg.from + " " + optionsArg.to);
|
|
||||||
done.resolve();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY2xvbmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGdpdC5jbG9uZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBTyxPQUFPLFdBQVcsb0JBQW9CLENBQUMsQ0FBQztBQUdwQyxhQUFLLEdBQUcsVUFBQyxVQU1uQjtJQUNHLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsT0FBTyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUM5QyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxlQUFhLFVBQVUsQ0FBQyxJQUFJLFNBQUksVUFBVSxDQUFDLEVBQUksQ0FBQyxDQUFDO0lBQ3RFLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNmLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9
|
|
1
dist/smartgit.commit.d.ts
vendored
1
dist/smartgit.commit.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let commit: (dirPathArg: string, commitMessage: string) => any;
|
|
17
dist/smartgit.commit.js
vendored
17
dist/smartgit.commit.js
vendored
@ -1,17 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
var helpers = require("./smartgit.helpers");
|
|
||||||
exports.commit = function (dirPathArg, commitMessage) {
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
if (!helpers.isGitDirectory(dirPathArg)) {
|
|
||||||
plugins.beautylog.error("smartgit.commit expects a valid git directory");
|
|
||||||
done.reject();
|
|
||||||
return done.promise;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
// if everything is all right proceed
|
|
||||||
plugins.shelljs.exec("git commit -m \"" + commitMessage + "\"");
|
|
||||||
done.resolve();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuY29tbWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQuY29tbWl0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBQzlDLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFbkMsY0FBTSxHQUFHLFVBQUMsVUFBaUIsRUFBQyxhQUFvQjtJQUN2RCxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLEVBQUUsQ0FBQSxDQUFDLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFBLENBQUM7UUFDcEMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsK0NBQStDLENBQUMsQ0FBQztRQUN6RSxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUM7UUFDZCxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQUEsQ0FBQztJQUNGLHFDQUFxQztJQUNyQyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxxQkFBa0IsYUFBYSxPQUFHLENBQUMsQ0FBQztJQUN6RCxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDZixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUMifQ==
|
|
1
dist/smartgit.helpers.d.ts
vendored
1
dist/smartgit.helpers.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let isGitDirectory: (dirPathArg: any) => boolean;
|
|
6
dist/smartgit.helpers.js
vendored
6
dist/smartgit.helpers.js
vendored
@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
exports.isGitDirectory = function (dirPathArg) {
|
|
||||||
return plugins.smartfile.fs.isDirectory(plugins.path.join(dirPathArg, ".git"));
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFFbkMsc0JBQWMsR0FBRyxVQUFDLFVBQVU7SUFDbkMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLFdBQVcsQ0FDbkMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFDLE1BQU0sQ0FBQyxDQUN2QyxDQUFDO0FBQ04sQ0FBQyxDQUFBIn0=
|
|
1
dist/smartgit.init.d.ts
vendored
1
dist/smartgit.init.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let init: (dirPathArg: string) => any;
|
|
15
dist/smartgit.init.js
vendored
15
dist/smartgit.init.js
vendored
@ -1,15 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
exports.init = function (dirPathArg) {
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
if (typeof dirPathArg == "undefined") {
|
|
||||||
plugins.beautylog.error("smartgit.init requires an absolute directory path!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
plugins.smartfile.fs.ensureDir(dirPathArg);
|
|
||||||
plugins.shelljs.exec("(cd " + dirPathArg + " && git init)");
|
|
||||||
done.resolve(dirPathArg);
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQuaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LmluaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFcEMsWUFBSSxHQUFHLFVBQUMsVUFBaUI7SUFDaEMsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixFQUFFLENBQUMsQ0FBQyxPQUFPLFVBQVUsSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ25DLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLG9EQUFvRCxDQUFDLENBQUM7UUFDOUUsTUFBTSxDQUFDO0lBQ1gsQ0FBQztJQUFBLENBQUM7SUFDRixPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLENBQUM7SUFDM0MsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsU0FBTyxVQUFVLGtCQUFlLENBQUMsQ0FBQztJQUN2RCxJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9
|
|
8
dist/smartgit.plugins.d.ts
vendored
8
dist/smartgit.plugins.d.ts
vendored
@ -1,8 +0,0 @@
|
|||||||
import "typings-global";
|
|
||||||
export import path = require("path");
|
|
||||||
export import beautylog = require("beautylog");
|
|
||||||
export declare let Q: any;
|
|
||||||
export declare let shelljs: any;
|
|
||||||
export import smartfile = require("smartfile");
|
|
||||||
export import smartpath = require("smartpath");
|
|
||||||
export import smartstring = require("smartstring");
|
|
10
dist/smartgit.plugins.js
vendored
10
dist/smartgit.plugins.js
vendored
@ -1,10 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-global");
|
|
||||||
exports.path = require("path");
|
|
||||||
exports.beautylog = require("beautylog");
|
|
||||||
exports.Q = require("q");
|
|
||||||
exports.shelljs = require("shelljs");
|
|
||||||
exports.smartfile = require("smartfile");
|
|
||||||
exports.smartpath = require("smartpath");
|
|
||||||
exports.smartstring = require("smartstring");
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUVWLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ3BDLFNBQUMsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDakIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUMxQixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDakMsbUJBQVcsV0FBVyxhQUFhLENBQUMsQ0FBQyJ9
|
|
1
dist/smartgit.pull.d.ts
vendored
1
dist/smartgit.pull.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let pull: (dirPathArg: string, sourceArg?: string, branchArg?: string) => any;
|
|
18
dist/smartgit.pull.js
vendored
18
dist/smartgit.pull.js
vendored
@ -1,18 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
var helpers = require("./smartgit.helpers");
|
|
||||||
exports.pull = function (dirPathArg, sourceArg, branchArg) {
|
|
||||||
if (sourceArg === void 0) { sourceArg = ""; }
|
|
||||||
if (branchArg === void 0) { branchArg = ""; }
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
if (!helpers.isGitDirectory(dirPathArg)) {
|
|
||||||
plugins.beautylog.error("smartgit.pull expects a valid git directory");
|
|
||||||
done.reject();
|
|
||||||
return done.promse;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
plugins.shelljs.exec("(cd " + dirPathArg + " && git pull " + sourceArg + " " + branchArg + ")");
|
|
||||||
done.resolve(dirPathArg);
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1bGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFDLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJCLGNBQXFCO0lBQzdFLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUNwQyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1FBQ3ZFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNkLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDO0lBQ3ZCLENBQUM7SUFBQSxDQUFDO0lBQ0YsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsU0FBTyxVQUFVLHFCQUFnQixTQUFTLFNBQUksU0FBUyxNQUFHLENBQUMsQ0FBQztJQUNqRixJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9
|
|
1
dist/smartgit.push.d.ts
vendored
1
dist/smartgit.push.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let push: (dirPathArg: string, sourceArg?: string, branchArg?: string) => any;
|
|
18
dist/smartgit.push.js
vendored
18
dist/smartgit.push.js
vendored
@ -1,18 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
var helpers = require("./smartgit.helpers");
|
|
||||||
exports.push = function (dirPathArg, sourceArg, branchArg) {
|
|
||||||
if (sourceArg === void 0) { sourceArg = ""; }
|
|
||||||
if (branchArg === void 0) { branchArg = ""; }
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
if (!helpers.isGitDirectory(dirPathArg)) {
|
|
||||||
plugins.beautylog.error("smartgit.push expects a valid git directory");
|
|
||||||
done.reject();
|
|
||||||
return done.promise;
|
|
||||||
}
|
|
||||||
// if everything seems allright proceed
|
|
||||||
plugins.shelljs.exec("");
|
|
||||||
done.resolve();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z2l0LnB1c2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDOUMsSUFBWSxPQUFPLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUVuQyxZQUFJLEdBQUcsVUFBQyxVQUFpQixFQUFFLFNBQXFCLEVBQUUsU0FBcUI7SUFBNUMseUJBQXFCLEdBQXJCLGNBQXFCO0lBQUUseUJBQXFCLEdBQXJCLGNBQXFCO0lBQzlFLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUEsQ0FBQztRQUNwQyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1FBQ3ZFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUNkLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3hCLENBQUM7SUFDRCx1Q0FBdUM7SUFDdkMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDekIsSUFBSSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ2YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDIn0=
|
|
4
dist/smartgit.remote.d.ts
vendored
4
dist/smartgit.remote.d.ts
vendored
@ -1,4 +0,0 @@
|
|||||||
export declare let remote: {
|
|
||||||
add: (dirPathArg: any) => void;
|
|
||||||
remove: () => void;
|
|
||||||
};
|
|
12
dist/smartgit.remote.js
vendored
12
dist/smartgit.remote.js
vendored
@ -1,12 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var plugins = require("./smartgit.plugins");
|
|
||||||
var addRemote = function (dirPathArg) {
|
|
||||||
var done = plugins.Q.defer();
|
|
||||||
};
|
|
||||||
var removeRemote = function () {
|
|
||||||
};
|
|
||||||
exports.remote = {
|
|
||||||
add: addRemote,
|
|
||||||
remove: removeRemote
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRnaXQucmVtb3RlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRnaXQucmVtb3RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFZLE9BQU8sV0FBTSxvQkFBb0IsQ0FBQyxDQUFBO0FBRzlDLElBQUksU0FBUyxHQUFHLFVBQUMsVUFBVTtJQUN2QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0FBRWpDLENBQUMsQ0FBQztBQUVGLElBQUksWUFBWSxHQUFHO0FBRW5CLENBQUMsQ0FBQTtBQUVVLGNBQU0sR0FBRztJQUNoQixHQUFHLEVBQUUsU0FBUztJQUNkLE1BQU0sRUFBRSxZQUFZO0NBQ3ZCLENBQUEifQ==
|
|
90
index.js
90
index.js
@ -1,90 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
var SmartgitPlugins;
|
|
||||||
(function (SmartgitPlugins) {
|
|
||||||
SmartgitPlugins.init = function () {
|
|
||||||
var plugins = {
|
|
||||||
path: require("path"),
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
nodegit: require("nodegit"),
|
|
||||||
Q: require("q")
|
|
||||||
};
|
|
||||||
return plugins;
|
|
||||||
};
|
|
||||||
})(SmartgitPlugins || (SmartgitPlugins = {}));
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var SmartgitClone;
|
|
||||||
(function (SmartgitClone) {
|
|
||||||
function init() {
|
|
||||||
var clone = function (options) {
|
|
||||||
/***** 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;
|
|
||||||
}
|
|
||||||
/***** Path Checks ******/
|
|
||||||
if (!/^\/.*/.test(options.to)) {
|
|
||||||
plugins.beautylog.error("It seems that the given path " + options.to + " is not absolute.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
plugins.beautylog.log("Now cloning " + options.from);
|
|
||||||
var cloneOptions = {};
|
|
||||||
var cloneRepository = plugins.nodegit.Clone(options.from, options.to, cloneOptions);
|
|
||||||
smartgit.check(cloneRepository);
|
|
||||||
};
|
|
||||||
return clone;
|
|
||||||
}
|
|
||||||
SmartgitClone.init = init;
|
|
||||||
})(SmartgitClone || (SmartgitClone = {}));
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var SmartgitInit;
|
|
||||||
(function (SmartgitInit) {
|
|
||||||
SmartgitInit.init = function () {
|
|
||||||
var gitinit = function (dest) {
|
|
||||||
if (dest === void 0) { dest = "undefined"; }
|
|
||||||
if (dest == "undefined") {
|
|
||||||
return; // ...and return function here if not
|
|
||||||
}
|
|
||||||
var isBare = 0; //lets create a subfolder
|
|
||||||
plugins.nodegit.Repository.init(dest, isBare).then(function (repo) {
|
|
||||||
// do something with repo here.
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return gitinit;
|
|
||||||
};
|
|
||||||
})(SmartgitInit || (SmartgitInit = {}));
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var SmartgitCommit;
|
|
||||||
(function (SmartgitCommit) {
|
|
||||||
SmartgitCommit.init = function () {
|
|
||||||
var commit = function (pathArg, commitMessage) {
|
|
||||||
var result = plugins.nodegit.index.addByPath(pathArg);
|
|
||||||
if (result == 0) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return commit;
|
|
||||||
};
|
|
||||||
})(SmartgitCommit || (SmartgitCommit = {}));
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var SmartgitCheck;
|
|
||||||
(function (SmartgitCheck) {
|
|
||||||
SmartgitCheck.init = function () {
|
|
||||||
var check = function () {
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
return check;
|
|
||||||
};
|
|
||||||
})(SmartgitCheck || (SmartgitCheck = {}));
|
|
||||||
/// <reference path="typings/tsd.d.ts" />
|
|
||||||
/// <reference path="smartgit.plugins.ts" />
|
|
||||||
/// <reference path="smartgit.clone.ts" />
|
|
||||||
/// <reference path="smartgit.init.ts" />
|
|
||||||
/// <reference path="smartgit.commit.ts" />
|
|
||||||
/// <reference path="smartgit.check.ts" />
|
|
||||||
var plugins = SmartgitPlugins.init();
|
|
||||||
//Build the smartgit object
|
|
||||||
var smartgit = {};
|
|
||||||
smartgit.clone = SmartgitClone.init();
|
|
||||||
smartgit.commit = SmartgitCommit.init();
|
|
||||||
smartgit.check = SmartgitCheck.init();
|
|
||||||
smartgit.init = SmartgitInit.init();
|
|
||||||
module.exports = smartgit;
|
|
22
npmextra.json
Normal file
22
npmextra.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"npmts": {
|
||||||
|
"mode": "default",
|
||||||
|
"codecov": true,
|
||||||
|
"coverageTreshold": 71
|
||||||
|
},
|
||||||
|
"npmci": {
|
||||||
|
"globalNpmTools": [
|
||||||
|
"npmts"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "smartgit",
|
||||||
|
"shortDescription": "smart wrapper for nodegit",
|
||||||
|
"npmPackagename": "@pushrocks/smartgit",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"mode":"default",
|
|
||||||
"codecov":true,
|
|
||||||
"coverageTreshold":71
|
|
||||||
}
|
|
2535
package-lock.json
generated
Normal file
2535
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
54
package.json
54
package.json
@ -1,17 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "smartgit",
|
"name": "@pushrocks/smartgit",
|
||||||
"version": "0.1.4",
|
"version": "1.0.8",
|
||||||
"description": "an easy wrapper for nodegit",
|
"description": "smart wrapper for nodegit",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cleanTest": "rm -rf test/temp && rm -rf test/temp2",
|
"test": "(tstest test/)",
|
||||||
"test": "(npm run cleanTest && npmts)",
|
"build": "(tsbuild)"
|
||||||
"install": "node dist/postinstall.js"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pushrocks/smartgit.git"
|
"url": "https://gitlab.com/pushrocks/smartgit.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"json",
|
"json",
|
||||||
@ -21,22 +20,35 @@
|
|||||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pushrocks/smartgit/issues"
|
"url": "https://gitlab.com/pushrocks/smartgit/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/smartgit",
|
"homepage": "https://gitlab.com/pushrocks/smartgit",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/minimatch": "*",
|
"@pushrocks/smartfile": "^7.0.2",
|
||||||
"beautylog": "^5.0.13",
|
"@pushrocks/smartpath": "^4.0.1",
|
||||||
"q": "^1.4.1",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"shelljs": "^0.7.0",
|
"@pushrocks/smartshell": "^2.0.23",
|
||||||
"smartfile": "^4.0.10",
|
"@pushrocks/smartstring": "^3.0.10",
|
||||||
"smartpath": "^3.2.2",
|
"@types/minimatch": "^3.0.3",
|
||||||
"smartstring": "^2.0.10",
|
"@types/nodegit": "^0.24.8",
|
||||||
"typings-global": "^1.0.5"
|
"nodegit": "^0.24.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npmts-g": "^5.2.6",
|
"@gitzone/tsbuild": "^2.1.11",
|
||||||
"should": "^9.0.2",
|
"@gitzone/tstest": "^1.0.24",
|
||||||
"typings-test": "^1.0.1"
|
"@pushrocks/tapbundle": "^3.0.9",
|
||||||
}
|
"tslint": "^5.17.0",
|
||||||
|
"tslint-config-prettier": "^1.18.0"
|
||||||
|
},
|
||||||
|
"private": false,
|
||||||
|
"files": [
|
||||||
|
"ts/*",
|
||||||
|
"ts_web/*",
|
||||||
|
"dist/*",
|
||||||
|
"dist_web/*",
|
||||||
|
"assets/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
9
test.js
9
test.js
@ -1,9 +0,0 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
|
||||||
var smartgit = require("./index.js");
|
|
||||||
var beautylog = require("beautylog");
|
|
||||||
var path = require("path");
|
|
||||||
smartgit.clone({
|
|
||||||
from: "https://github.com/pushrocks/docs.git",
|
|
||||||
to: path.resolve("./test/temp/")
|
|
||||||
});
|
|
||||||
beautylog.success("Test successfull");
|
|
2
test/test.d.ts
vendored
2
test/test.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
import "typings-test";
|
|
||||||
import "should";
|
|
34
test/test.js
34
test/test.js
@ -1,34 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-test");
|
|
||||||
var path = require("path");
|
|
||||||
require("should");
|
|
||||||
var smartgit = require("../dist/index");
|
|
||||||
describe("smartgit", function () {
|
|
||||||
describe(".clone", function () {
|
|
||||||
it("should clone a repository using ssh and sshkey", function (done) {
|
|
||||||
this.timeout(20000);
|
|
||||||
smartgit.clone({
|
|
||||||
from: "git@gitlab.com:sandboxzone/sandbox-testrepo.git",
|
|
||||||
to: path.resolve("./test/temp/")
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it("should clone a repository using https", function (done) {
|
|
||||||
this.timeout(20000);
|
|
||||||
smartgit.clone({
|
|
||||||
from: "https://gitlab.com/sandboxzone/sandbox-testrepo.git",
|
|
||||||
to: path.resolve("./test/temp2/")
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
describe(".check", function () {
|
|
||||||
});
|
|
||||||
describe("commit", function () {
|
|
||||||
});
|
|
||||||
describe("init", function () {
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFFdEIsSUFBTyxJQUFJLFdBQVcsTUFBTSxDQUFDLENBQUM7QUFDOUIsUUFBTyxRQUVQLENBQUMsQ0FGYztBQUVmLElBQU8sUUFBUSxXQUFXLGVBQWUsQ0FBQyxDQUFDO0FBRTNDLFFBQVEsQ0FBQyxVQUFVLEVBQUM7SUFDaEIsUUFBUSxDQUFDLFFBQVEsRUFBQztRQUNkLEVBQUUsQ0FBQyxnREFBZ0QsRUFBQyxVQUFTLElBQUk7WUFDN0QsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNwQixRQUFRLENBQUMsS0FBSyxDQUFDO2dCQUNYLElBQUksRUFBQyxpREFBaUQ7Z0JBQ3RELEVBQUUsRUFBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGNBQWMsQ0FBQzthQUNsQyxDQUFDLENBQUMsSUFBSSxDQUFDO2dCQUNKLElBQUksRUFBRSxDQUFDO1lBQ1gsQ0FBQyxDQUFDLENBQUM7UUFDUCxDQUFDLENBQUMsQ0FBQztRQUNILEVBQUUsQ0FBQyx1Q0FBdUMsRUFBQyxVQUFTLElBQUk7WUFDcEQsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNwQixRQUFRLENBQUMsS0FBSyxDQUFDO2dCQUNYLElBQUksRUFBQyxxREFBcUQ7Z0JBQzFELEVBQUUsRUFBQyxJQUFJLENBQUMsT0FBTyxDQUFDLGVBQWUsQ0FBQzthQUNuQyxDQUFDLENBQUMsSUFBSSxDQUFDO2dCQUNKLElBQUksRUFBRSxDQUFDO1lBQ1gsQ0FBQyxDQUFDLENBQUM7UUFDUCxDQUFDLENBQUMsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFDO0lBQ0gsUUFBUSxDQUFDLFFBQVEsRUFBQztJQUVsQixDQUFDLENBQUMsQ0FBQztJQUNILFFBQVEsQ0FBQyxRQUFRLEVBQUM7SUFFbEIsQ0FBQyxDQUFDLENBQUM7SUFDSCxRQUFRLENBQUMsTUFBTSxFQUFDO0lBRWhCLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMifQ==
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC3C,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE/B,QAAQ,CAAC,UAAU,EAAC;IAChB,QAAQ,CAAC,QAAQ,EAAC;QACd,EAAE,CAAC,2BAA2B,EAAC,UAAS,IAAI;YACxC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,QAAQ,CAAC,KAAK,CAAC;gBACX,IAAI,EAAC,uCAAuC;gBAC5C,EAAE,EAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;aAClC,CAAC,CAAC,IAAI,CAAC;gBACJ,IAAI,EAAE,CAAC;YACX,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAC;IAElB,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAC;IAElB,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,EAAC;IAEhB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
40
test/test.ts
40
test/test.ts
@ -1,38 +1,4 @@
|
|||||||
import "typings-test";
|
import { tap, expect } from '@pushrocks/tapbundle';
|
||||||
import beautylog = require("beautylog");
|
import * as smartgit from '../ts/index';
|
||||||
import path = require("path");
|
|
||||||
import "should"
|
|
||||||
|
|
||||||
import smartgit = require("../dist/index");
|
tap.start();
|
||||||
|
|
||||||
describe("smartgit",function(){
|
|
||||||
describe(".clone",function(){
|
|
||||||
it("should clone a repository using ssh and sshkey",function(done){
|
|
||||||
this.timeout(20000);
|
|
||||||
smartgit.clone({
|
|
||||||
from:"git@gitlab.com:sandboxzone/sandbox-testrepo.git",
|
|
||||||
to:path.resolve("./test/temp/")
|
|
||||||
}).then(function(){
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it("should clone a repository using https",function(done){
|
|
||||||
this.timeout(20000);
|
|
||||||
smartgit.clone({
|
|
||||||
from:"https://gitlab.com/sandboxzone/sandbox-testrepo.git",
|
|
||||||
to:path.resolve("./test/temp2/")
|
|
||||||
}).then(function(){
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
describe(".check",function(){
|
|
||||||
|
|
||||||
});
|
|
||||||
describe("commit",function(){
|
|
||||||
|
|
||||||
});
|
|
||||||
describe("init",function(){
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
10
ts/index.ts
10
ts/index.ts
@ -1,9 +1,3 @@
|
|||||||
import plugins = require("./smartgit.plugins");
|
import plugins = require('./smartgit.plugins');
|
||||||
|
|
||||||
export {add} from "./smartgit.add";
|
export * from './smartgit.classes.gitrepo';
|
||||||
export {clone} from "./smartgit.clone";
|
|
||||||
export {commit} from "./smartgit.commit";
|
|
||||||
export {init} from "./smartgit.init";
|
|
||||||
export {pull} from "./smartgit.pull";
|
|
||||||
export {push} from "./smartgit.push";
|
|
||||||
export {remote} from "./smartgit.remote";
|
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
let shelljs = require("shelljs");
|
|
||||||
import beautylog = require("beautylog");
|
|
@ -1,15 +0,0 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
|
||||||
import * as helpers from "./smartgit.helpers";
|
|
||||||
|
|
||||||
export let add = (dirPathArg:string) => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
if(!helpers.isGitDirectory(dirPathArg)){
|
|
||||||
plugins.beautylog.error("smartgit.add expects a valif git directory!");
|
|
||||||
done.reject();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
// if everything is ok proceed
|
|
||||||
plugins.shelljs.exec("");
|
|
||||||
done.resolve(dirPathArg);
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
@ -1,4 +0,0 @@
|
|||||||
import plugins = require("./smartgit.plugins");
|
|
||||||
export = function(repoArg) {
|
|
||||||
return true;
|
|
||||||
};
|
|
59
ts/smartgit.classes.gitrepo.ts
Normal file
59
ts/smartgit.classes.gitrepo.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import * as plugins from './smartgit.plugins';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class GitRepo allows access to git directories from node
|
||||||
|
*/
|
||||||
|
export class GitRepo {
|
||||||
|
// STATIC
|
||||||
|
/**
|
||||||
|
* creates a new GitRepo Instance after cloning a project
|
||||||
|
*/
|
||||||
|
public static async createRepoFromClone(fromArg: string, toArg: string): Promise<GitRepo> {
|
||||||
|
const dirArg = plugins.path.resolve(toArg);
|
||||||
|
const ngRespository = await plugins.nodegit.Clone.clone(fromArg, toArg, {
|
||||||
|
bare: 0,
|
||||||
|
checkoutBranch: 'master'
|
||||||
|
});
|
||||||
|
return new GitRepo(ngRespository);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async createNewRepoInDir(dirArg: string): Promise<GitRepo> {
|
||||||
|
dirArg = plugins.path.resolve(dirArg);
|
||||||
|
const ngRepository = await plugins.nodegit.Repository.init(dirArg, 0);
|
||||||
|
return new GitRepo(ngRepository);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async openRepoAt(dirArg: string) {
|
||||||
|
dirArg = plugins.path.resolve(dirArg);
|
||||||
|
const ngRepository = await plugins.nodegit.Repository.open(dirArg);
|
||||||
|
return new GitRepo(ngRepository);
|
||||||
|
}
|
||||||
|
|
||||||
|
// INSTANCE
|
||||||
|
public nodegitRepo: plugins.nodegit.Repository;
|
||||||
|
|
||||||
|
constructor(nodegitRepoArg: plugins.nodegit.Repository) {
|
||||||
|
this.nodegitRepo = nodegitRepoArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lists remotes
|
||||||
|
*/
|
||||||
|
public async listRemotes(): Promise<string[]> {
|
||||||
|
return this.nodegitRepo.getRemotes();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the url for a specific remote
|
||||||
|
*/
|
||||||
|
public async getUrlForRemote(remoteName: string) {
|
||||||
|
const ngRemote = await this.nodegitRepo.getRemote(remoteName);
|
||||||
|
return ngRemote.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async pushBranchToRemote(branchName: string, remoteName: string) {
|
||||||
|
await this.nodegitRepo.checkoutBranch(branchName);
|
||||||
|
const ngRemote = await this.nodegitRepo.getRemote(remoteName);
|
||||||
|
ngRemote.push([branchName]);
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +0,0 @@
|
|||||||
import plugins = require("./smartgit.plugins");
|
|
||||||
import SmartgitCheck = require("./smartgit.check");
|
|
||||||
|
|
||||||
export let clone = (optionsArg: {
|
|
||||||
from: string,
|
|
||||||
to: string,
|
|
||||||
key?: string,
|
|
||||||
keyPath?: string,
|
|
||||||
keyPassphrase?: string
|
|
||||||
}) => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
plugins.smartfile.fs.ensureDir(optionsArg.to);
|
|
||||||
plugins.shelljs.exec(`git clone ${optionsArg.from} ${optionsArg.to}`);
|
|
||||||
done.resolve();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
@ -1,15 +0,0 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
|
||||||
import * as helpers from "./smartgit.helpers";
|
|
||||||
|
|
||||||
export let commit = (dirPathArg:string,commitMessage:string) => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
if(!helpers.isGitDirectory(dirPathArg)){
|
|
||||||
plugins.beautylog.error("smartgit.commit expects a valid git directory");
|
|
||||||
done.reject();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
||||||
// if everything is all right proceed
|
|
||||||
plugins.shelljs.exec(`git commit -m "${commitMessage}"`);
|
|
||||||
done.resolve();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
@ -1,7 +0,0 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
|
||||||
|
|
||||||
export let isGitDirectory = (dirPathArg):boolean => {
|
|
||||||
return plugins.smartfile.fs.isDirectory(
|
|
||||||
plugins.path.join(dirPathArg,".git")
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
import plugins = require("./smartgit.plugins");
|
|
||||||
|
|
||||||
export let init = (dirPathArg:string) => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
if (typeof dirPathArg == "undefined") { //lets check if a destination is defined...
|
|
||||||
plugins.beautylog.error("smartgit.init requires an absolute directory path!");
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
plugins.smartfile.fs.ensureDir(dirPathArg);
|
|
||||||
plugins.shelljs.exec(`(cd ${dirPathArg} && git init)`);
|
|
||||||
done.resolve(dirPathArg);
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
@ -1,9 +1,16 @@
|
|||||||
import "typings-global";
|
// node native
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
export import path = require("path");
|
export { path };
|
||||||
export import beautylog = require("beautylog");
|
|
||||||
export let Q = require("q");
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
export let shelljs = require("shelljs");
|
import * as smartpath from '@pushrocks/smartpath';
|
||||||
export import smartfile = require("smartfile");
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
export import smartpath = require("smartpath");
|
import * as smartstring from '@pushrocks/smartstring';
|
||||||
export import smartstring = require("smartstring");
|
|
||||||
|
export { smartfile, smartpath, smartpromise, smartstring };
|
||||||
|
|
||||||
|
// third party
|
||||||
|
import * as nodegit from 'nodegit';
|
||||||
|
|
||||||
|
export { nodegit };
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
|
||||||
import * as helpers from "./smartgit.helpers";
|
|
||||||
|
|
||||||
export let pull = (dirPathArg:string,sourceArg:string = "", branchArg:string = "") => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
if(!helpers.isGitDirectory(dirPathArg)){
|
|
||||||
plugins.beautylog.error("smartgit.pull expects a valid git directory");
|
|
||||||
done.reject();
|
|
||||||
return done.promse;
|
|
||||||
};
|
|
||||||
plugins.shelljs.exec(`(cd ${dirPathArg} && git pull ${sourceArg} ${branchArg})`);
|
|
||||||
done.resolve(dirPathArg);
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
@ -1,15 +0,0 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
|
||||||
import * as helpers from "./smartgit.helpers";
|
|
||||||
|
|
||||||
export let push = (dirPathArg:string, sourceArg:string = "", branchArg:string = "") => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
if(!helpers.isGitDirectory(dirPathArg)){
|
|
||||||
plugins.beautylog.error("smartgit.push expects a valid git directory");
|
|
||||||
done.reject();
|
|
||||||
return done.promise;
|
|
||||||
}
|
|
||||||
// if everything seems allright proceed
|
|
||||||
plugins.shelljs.exec("");
|
|
||||||
done.resolve();
|
|
||||||
return done.promise;
|
|
||||||
};
|
|
@ -1,16 +0,0 @@
|
|||||||
import * as plugins from "./smartgit.plugins";
|
|
||||||
import * as helpers from "./smartgit.helpers";
|
|
||||||
|
|
||||||
let addRemote = (dirPathArg) => {
|
|
||||||
let done = plugins.Q.defer();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
let removeRemote = () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export let remote = {
|
|
||||||
add: addRemote,
|
|
||||||
remove: removeRemote
|
|
||||||
}
|
|
17
tslint.json
Normal file
17
tslint.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
|
"rules": {
|
||||||
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
|
}
|
Reference in New Issue
Block a user