-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to include only package.json
in the source directory
#274
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,7 +229,7 @@ Lambda.prototype._fileCopy = function (program, src, dest, excludeNodeModules, c | |
const options = { | ||
dereference: true, // same meaning as `-L` of `rsync` command | ||
filter: function (src, dest) { | ||
if (!program.prebuiltDirectory && path.basename(src) == 'package.json') { | ||
if (!program.prebuiltDirectory && src == path.join(srcAbsolutePath, 'package.json')) { | ||
// include package.json unless prebuiltDirectory is set | ||
return true; | ||
} | ||
|
@@ -272,7 +272,7 @@ Lambda.prototype._rsync = function (program, src, dest, excludeNodeModules, call | |
} | ||
|
||
// include package.json unless prebuiltDirectory is set | ||
var includeArgs = program.prebuiltDirectory ? '' : '--include package.json '; | ||
var includeArgs = program.prebuiltDirectory ? '' : '--include /package.json '; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure, but the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The src directory
exclude='foo/*'include='package.json'
include='/package.json'
exclude='foo'include='package.json'
include='/package.json'
|
||
|
||
// we need the extra / after src to make sure we are copying the content | ||
// of the directory, not the directory itself. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,7 @@ describe('node-lambda', function () { | |
fs.mkdirsSync(path.join('__unittest', 'hoge')); | ||
fs.mkdirsSync(path.join('__unittest', 'fuga')); | ||
fs.writeFileSync(path.join('__unittest', 'hoge', 'piyo')); | ||
fs.writeFileSync(path.join('__unittest', 'hoge', 'package.json')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The setting to exclude |
||
fs.writeFileSync('fuga'); | ||
}); | ||
after(function () { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed