We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
this variable is only available in the "template for a test file". it's a simple fix that could really help us. Thanks, Dan
The text was updated successfully, but these errors were encountered:
createAWSNodeJSFuncFile(handlerPath) {
const functionName = this.options.f || this.options.function;
const handlerInfo = path.parse(handlerPath); const handlerDir = path.join(this.serverless.config.servicePath, handlerInfo.dir); const handlerFile = `${handlerInfo.name}.js`; const handlerFunction = handlerInfo.ext.replace(/^\./, ''); let templateFile = path.join(__dirname, functionTemplateFile); if (this.serverless.service.custom && this.serverless.service.custom['serverless-mocha-plugin'] && this.serverless.service.custom['serverless-mocha-plugin'].functionTemplate) { templateFile = path.join(this.serverless.config.servicePath, this.serverless.service.custom['serverless-mocha-plugin'].functionTemplate); } const templateText = fse.readFileSync(templateFile).toString(); const jsFile = ejs.render(templateText, {
handlerFunction, functionName
}); const filePath = path.join(handlerDir, handlerFile); this.serverless.utils.writeFileDir(filePath); if (this.serverless.utils.fileExistsSync(filePath)) { const errorMessage = [ `File "${filePath}" already exists. Cannot create function.`, ].join(''); throw new this.serverless.classes.Error(errorMessage); } fse.writeFileSync(path.join(handlerDir, handlerFile), jsFile); this.serverless.cli.log(`Created function file "${path.join(handlerDir, handlerFile)}"`); return BbPromise.resolve();
}
Sorry, something went wrong.
No branches or pull requests
Hi,
this variable is only available in the "template for a test file".
it's a simple fix that could really help us.
Thanks,
Dan
The text was updated successfully, but these errors were encountered: