mirror of
https://github.com/serverless/serverless.git
synced 2026-02-01 16:07:28 +00:00
Raise error if no file matches before zipping
This commit is contained in:
parent
e29397ca5c
commit
d5f5f92f48
@ -34,16 +34,23 @@ module.exports = {
|
||||
|
||||
const output = fs.createWriteStream(artifactFilePath);
|
||||
|
||||
const files = globby.sync(patterns, {
|
||||
cwd: this.serverless.config.servicePath,
|
||||
dot: true,
|
||||
silent: true,
|
||||
follow: true,
|
||||
});
|
||||
|
||||
if (files.length === 0) {
|
||||
const err = new this.serverless.classes.Error('No file matched by your include/exclude patterns');
|
||||
return new BbPromise((resolve, reject) => {
|
||||
reject(err);
|
||||
});
|
||||
}
|
||||
|
||||
output.on('open', () => {
|
||||
zip.pipe(output);
|
||||
|
||||
const files = globby.sync(patterns, {
|
||||
cwd: this.serverless.config.servicePath,
|
||||
dot: true,
|
||||
silent: true,
|
||||
follow: true,
|
||||
});
|
||||
|
||||
files.forEach((filePath) => {
|
||||
const fullPath = path.resolve(
|
||||
this.serverless.config.servicePath,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user