Skip to content

Commit

Permalink
Merge 23f2827 into b21c1e4
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamba committed Jul 2, 2021
2 parents b21c1e4 + 23f2827 commit 81231be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/plugins/package/lib/packageService.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = {
if (shouldPackageService && !this.serverless.service.package.artifact) await this.packageAll();
},

packageAll() {
async packageAll() {
const zipFileName = `${this.serverless.service.service}.zip`;

return this.resolveFilePathsAll().then((filePaths) =>
Expand Down Expand Up @@ -145,7 +145,7 @@ module.exports = {
return artifactPath;
},

packageLayer(layerName) {
async packageLayer(layerName) {
const layerObject = this.serverless.service.getLayer(layerName);

const zipFileName = `${layerName}.zip`;
Expand Down Expand Up @@ -204,7 +204,7 @@ module.exports = {
);
},

resolveFilePathsFromPatterns(params, prefix) {
async resolveFilePathsFromPatterns(params, prefix) {
const patterns = [];
const devDependencyExcludeSet = params.devDependencyExcludeSet || new Set();

Expand Down
8 changes: 4 additions & 4 deletions lib/plugins/package/lib/zipService.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
return params;
},

zip(params) {
async zip(params) {
return this.resolveFilePathsFromPatterns(params).then((filePaths) =>
this.zipFiles(filePaths, params.zipFileName)
);
Expand All @@ -56,7 +56,7 @@ module.exports = {
* @param zipFiles - the filename to save the zip at
* @param prefix - a prefix to strip from the file names. use for layers support
*/
zipFiles(files, zipFileName, prefix) {
async zipFiles(files, zipFileName, prefix) {
if (files.length === 0) {
const error = new ServerlessError('No files to package', 'NO_FILES_TO_PACKAGE');
return BbPromise.reject(error);
Expand Down Expand Up @@ -103,7 +103,7 @@ module.exports = {
});
},

getFileContentAndStat(filePath) {
async getFileContentAndStat(filePath) {
const fullPath = path.resolve(this.serverless.serviceDir, filePath);

return BbPromise.all([
Expand Down Expand Up @@ -131,7 +131,7 @@ module.exports = {
},
};

function excludeNodeDevDependencies(serviceDir) {
async function excludeNodeDevDependencies(serviceDir) {
const exAndIn = {
include: [],
exclude: [],
Expand Down
5 changes: 3 additions & 2 deletions lib/plugins/package/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ class Package {
);
}
},
'package:createDeploymentArtifacts': () => BbPromise.bind(this).then(this.packageService),
'package:createDeploymentArtifacts': async () =>
BbPromise.bind(this).then(this.packageService),

'package:function:package': () => {
'package:function:package': async () => {
if (this.options.function) {
this.serverless.cli.log(`Packaging function: ${this.options.function}...`);
return BbPromise.resolve(this.packageFunction(this.options.function));
Expand Down

0 comments on commit 81231be

Please sign in to comment.