| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 1x 1x 1x 3x 3x 1x 1x 2x 1x 2x 1x | 'use strict';
const Sls = require('../../command');
const { ServerlessCommandError } = require('../../../common/errors');
const deployOne = ({ path, flags, logStream, stdout }) => {
const deploy = Sls.deploy(path, flags, stdout);
return deploy
.then(log => {
logStream.write(`\n[${path}]:\n${log}\n`);
return log;
})
.catch(err => {
if (err instanceof ServerlessCommandError) {
logStream.write(`\n[${path}]:\n${err.log}\n`);
}
return Promise.reject(err);
});
};
module.exports = deployOne;
|