Skip to content

Commit

Permalink
fix: when the projectLocation flag is used and no file property in th…
Browse files Browse the repository at this point in the history
…e package.json, use the correct location

fixes #303
  • Loading branch information
lholmquist committed Apr 5, 2019
1 parent 60ca6e7 commit 58e340a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/project-archiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function createArchive (config) {
// If Not, then just use the current directory "./"
logger.warning('a file property was not found in your package.json, archiving the current directory.');
// Get the list of files and directories
const fileList = await helpers.listFiles('./');
const fileList = await helpers.listFiles(config.projectLocation);
// Push those into the includedFiles
const filteredOut = fileList.filter((file) => {
// exclude the node_modules and .git directories and tmp
Expand Down
9 changes: 9 additions & 0 deletions test/project-archiver-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ test('test cleanup function', (t) => {
},
cleanUp: () => {
return Promise.resolve();
},
listFiles: () => {
return Promise.resolve([]);
}
},
tar: {
Expand Down Expand Up @@ -61,6 +64,9 @@ test('test error with create dir function', (t) => {
},
cleanUp: () => {
return Promise.resolve();
},
listFiles: () => {
return Promise.resolve([]);
}
}
});
Expand Down Expand Up @@ -117,6 +123,9 @@ test('test logger warning if no files prop', (t) => {
},
cleanUp: () => {
return Promise.resolve();
},
listFiles: () => {
return Promise.resolve([]);
}
},
tar: {
Expand Down

0 comments on commit 58e340a

Please sign in to comment.