cleanup after oneself

This commit is contained in:
LosslessBot 2016-07-13 16:06:16 +02:00
parent 5ccf5b81e2
commit be6fc3adfd
5 changed files with 7 additions and 5 deletions

0
dist/cert.hook.js vendored Normal file → Executable file
View File

3
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@ describe("cert", function () {
}); });
describe("Cert", function () { describe("Cert", function () {
it("should create a new Cert object from class", function () { it("should create a new Cert object from class", function () {
this.timeout(20000); this.timeout(40000);
testCert = new cert.Cert({ testCert = new cert.Cert({
cfEmail: process.env.CF_EMAIL, cfEmail: process.env.CF_EMAIL,
cfKey: process.env.CF_KEY, cfKey: process.env.CF_KEY,
@ -30,7 +30,7 @@ describe("cert", function () {
}); });
it("should get a valid certificate", function (done) { it("should get a valid certificate", function (done) {
this.timeout(120000); this.timeout(120000);
testCert.getDomainCert("hello2.bleu.de").then(function () { testCert.getDomainCert("hello4.bleu.de").then(function () {
done(); done();
}); });
}); });

View File

@ -22,7 +22,7 @@ describe("cert",function(){
}) })
describe("Cert",function(){ describe("Cert",function(){
it("should create a new Cert object from class",function(){ it("should create a new Cert object from class",function(){
this.timeout(20000); this.timeout(40000);
testCert = new cert.Cert({ testCert = new cert.Cert({
cfEmail: process.env.CF_EMAIL, cfEmail: process.env.CF_EMAIL,
cfKey: process.env.CF_KEY, cfKey: process.env.CF_KEY,
@ -34,7 +34,7 @@ describe("cert",function(){
}) })
it("should get a valid certificate",function(done){ it("should get a valid certificate",function(done){
this.timeout(120000); this.timeout(120000);
testCert.getDomainCert("hello2.bleu.de").then(() => { testCert.getDomainCert("hello4.bleu.de").then(() => {
done(); done();
}); });
}) })

View File

@ -77,6 +77,7 @@ export class Cert {
let fetchedCertsArray: string[] = plugins.smartfile.fs.listFoldersSync(paths.certDir); let fetchedCertsArray: string[] = plugins.smartfile.fs.listFoldersSync(paths.certDir);
if (fetchedCertsArray.indexOf(domainNameArg) != -1) { if (fetchedCertsArray.indexOf(domainNameArg) != -1) {
updateSslDirSync(this._sslDir, domainNameArg); updateSslDirSync(this._sslDir, domainNameArg);
plugins.smartfile.fs.removeSync(plugins.path.join(paths.certDir,domainNameArg));
} }
this.sslGitOriginAddCommitPush(); this.sslGitOriginAddCommitPush();
done.resolve(); done.resolve();