serverless/lib/plugins/aws/lib/validate.js
Mariusz Nowak 4944f471b1
Prettify
2019-06-26 12:43:01 +02:00

22 lines
503 B
JavaScript

'use strict';
const BbPromise = require('bluebird');
module.exports = {
validate() {
return new BbPromise((resolve, reject) => {
if (!this.serverless.config.servicePath) {
const error = new this.serverless.classes.Error(
'This command can only be run inside a service directory'
);
reject(error);
}
this.options.stage = this.provider.getStage();
this.options.region = this.provider.getRegion();
return resolve();
});
},
};