Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = async (root, pkg, release, customName) => {

const serviceFile = generateServiceFile(root, customPackage);
const specFile = generateSpecFile(specsDirectory, customPackage, release);
const archiveWhitelist = getArchiveWhitelist(pkg);
const archiveWhitelist = getArchiveWhitelist(customPackage);

await archiver.compress(root, sourcesArchive, archiveWhitelist);

Expand Down
20 changes: 19 additions & 1 deletion test/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('generate', () => {
{
files: undefined,
main: 'index.js',
service: 'my-cool-api.service'
service: 'penguin.service'
}
);
});
Expand All @@ -135,6 +135,24 @@ describe('generate', () => {
);
});

it('passes files and main values from the package.json to archiver using custom name', async () => {
await generate('/path/to/project', pkgWithWhitelist, null, 'penguin');
sandbox.assert.calledWith(
archiver.compress,
'/path/to/project',
'/path/to/project/SOURCES/penguin.tar.gz',
{
main: 'server.js',
files: [
'lib',
'routes',
'index.js'
],
service: 'penguin.service'
}
);
});

it('creates the service file with a custom name if specified', async () => {
await generate('/path/to/project', pkg, 1, 'penguin');
sandbox.assert.calledWith(
Expand Down