removing nodegit & check for dirty repo (#49)
This commit is contained in:
Родитель
8827c44054
Коммит
f1f616d342
|
@ -30,7 +30,6 @@
|
|||
"jstransformer-markdown": "^1.1.0",
|
||||
"live-server": "^0.9.0",
|
||||
"node-sass": "^3.4.2",
|
||||
"nodegit": "^0.14.1",
|
||||
"npm-run-all": "^1.4.0",
|
||||
"postcss": "^5.1.2",
|
||||
"postcss-cli": "^2.3.3",
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
let NodeGit = require(`nodegit`);
|
||||
let shell = require(`shelljs`);
|
||||
let pathToRepo = require(`path`).resolve(`.`);
|
||||
|
||||
let getStatus = (repo) => repo.getStatus();
|
||||
|
||||
let runDeploy = (remote) => {
|
||||
shell.echo(`Running deployment now...`);
|
||||
|
@ -33,21 +29,10 @@ let runDeploy = (remote) => {
|
|||
shell.echo(`Finished deploying!`);
|
||||
};
|
||||
|
||||
// Check that local repo is clean before deploying
|
||||
|
||||
NodeGit.Repository.open(pathToRepo)
|
||||
.then(getStatus)
|
||||
.then(status => {
|
||||
if (status.length) {
|
||||
shell.echo(`Repo is dirty. Aborting deploy!`);
|
||||
shell.exit(1);
|
||||
} else {
|
||||
// Check for remote argument
|
||||
if (process.argv[2]) {
|
||||
runDeploy(process.argv[2]);
|
||||
} else {
|
||||
shell.echo(`Missing target remote!`);
|
||||
shell.exit(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
// Check for remote argument
|
||||
if (process.argv[2]) {
|
||||
runDeploy(process.argv[2]);
|
||||
} else {
|
||||
shell.echo(`Missing target remote!`);
|
||||
shell.exit(2);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче