Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Aug 14, 2017
2 parents 32ff0ae + bdf8635 commit 8ab5415
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"mvn-artifact-filename": "1.0.5",
"mvn-artifact-name-parser": "1.0.4",
"mvn-artifact-url": "1.0.5",
"request": "2.79.0",
"request": "2.81.0",
"rimraf": "2.5.4",
"split": "1.0.0",
"which": "1.2.12",
Expand Down
10 changes: 5 additions & 5 deletions spec/commands/update.spec.ts
Expand Up @@ -34,7 +34,7 @@ describe('serenity update', () => {
'.cache': directoryWith(Artifact_File),
});

return expect(update({ cacheDir: '.cache' })).to.be.eventually.fulfilled
return expect(update({ cacheDir: '.cache', repository: defaults.repository })).to.be.eventually.fulfilled
.then(() => {
expect(log.writeOutput.pop()).to.contain('Serenity BDD CLI jar file is up to date');
});
Expand All @@ -48,7 +48,7 @@ describe('serenity update', () => {

mockfs({});

return expect(update({ cacheDir: '.' })).to.be.eventually.fulfilled
return expect(update({ cacheDir: '.' , repository: defaults.repository})).to.be.eventually.fulfilled
.then(() => {
expect(scope.isDone()).to.be.true;

Expand All @@ -64,7 +64,7 @@ describe('serenity update', () => {

mockfs({});

return expect(update({ cacheDir: '.' })).to.be.rejectedWith('ETIMEDOUT')
return expect(update({ cacheDir: '.', repository: defaults.repository})).to.be.rejectedWith('ETIMEDOUT')
.then(() => expect(log.errorOutput.pop()).to.contain(
'Looks like an error occurred downloading the Serenity BDD CLI jar. Are you behind a proxy or a firewall that needs to be configured? ETIMEDOUT'
));
Expand All @@ -78,7 +78,7 @@ describe('serenity update', () => {
'/inaccessible-dir': inaccessibleDirectoryWith({ 'some-file.sys': '' }),
});

return expect(update({ cacheDir: '/inaccessible-dir' }))
return expect(update({ cacheDir: '/inaccessible-dir', repository: defaults.repository }))
.to.be.eventually.rejected
.then(() => expect(log.errorOutput.pop()).to.contain(
'Couldn\'t access the cache directory. EACCES, permission denied'
Expand All @@ -91,7 +91,7 @@ describe('serenity update', () => {
'/inaccessible-dir': inaccessibleDirectoryWith({ 'some-file.sys': '' }),
});

return expect(update({ cacheDir: '/inaccessible-dir/cache' }))
return expect(update({ cacheDir: '/inaccessible-dir/cache', repository: defaults.repository }))
.to.be.eventually.rejectedWith('EACCES, permission denied \'/inaccessible-dir/cache\'')
.then(() => {
expect(log.errorOutput.pop()).to.contain('Couldn\'t create a cache directory. EACCES, permission denied');
Expand Down
6 changes: 5 additions & 1 deletion src/commands/update.ts
Expand Up @@ -20,13 +20,17 @@ export const builder = {
default: false,
describe: 'Ignore SSL certificates',
},
repository: {
default: defaults.repository,
describe: 'Set the maven repository',
},
};

export const handler = (argv: any) =>
adjustLogging(argv.log)
.then(ensureDirectoryIsPresent(path.resolve(process.cwd(), argv.cacheDir)))
.catch(complain('Couldn\'t create a cache directory. %s'))
.then(downloadArtifactIfNeeded(defaults.artifact, defaults.repository, argv.ignoreSSL))
.then(downloadArtifactIfNeeded(defaults.artifact, argv.repository, argv.ignoreSSL))
.catch(complain('%s'));

// --
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Expand Up @@ -10,7 +10,7 @@ export interface Configuration {
}

export const defaults: Configuration = {
artifact: 'net.serenity-bdd:serenity-cli:jar:all:1.2.4-rc.1',
artifact: 'net.serenity-bdd:serenity-cli:jar:all:1.2.4',
repository: 'https://dl.bintray.com/serenity/maven/',
cacheDir: path.resolve(__dirname, '../.cache'),
reportDir: path.resolve(process.cwd(), 'target/site/serenity'),
Expand Down

0 comments on commit 8ab5415

Please sign in to comment.