Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianpraja committed Nov 7, 2021
1 parent 6baa01e commit beb967a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ Lambda.prototype._parse_config_file = function( program ) {
//console.log( $configPath )

if (($config.PATH.substr(0,1) === '/') || ($config.PATH.substr(0,2) == '~/')) {
var $fullFunctionPath = ($config.PATH).replace(/\/\.\//g, '\/')
var $fullFunctionPath = ($config.PATH).replace(/\/\.\//g, '/')
} else {
var $fullFunctionPath = (process.cwd() + '/' + $configPath + '/' + $config.PATH).replace(/\/\.\//g, '\/')
var $fullFunctionPath = (process.cwd() + '/' + $configPath + '/' + $config.PATH).replace(/\/\.\//g, '/')
}

if ($fullFunctionPath.substr(-1) !== '/')
Expand Down Expand Up @@ -136,7 +136,7 @@ Lambda.prototype.deploy = function( program ) {
if (!$config.FunctionName)
$config.FunctionName = program.split('/').slice(-1)[0]

if (!/^([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$/.test($config.FunctionName)) {
if (!/^([a-zA-Z0-9-_.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$/.test($config.FunctionName)) {
console.log("Invalid function name", $config.FunctionName );
process.exit(-1);
}
Expand All @@ -157,9 +157,9 @@ Lambda.prototype.deploy = function( program ) {


if (($config.PATH.substr(0,1) === '/') || ($config.PATH.substr(0,2) == '~/')) {
var $fullFunctionPath = ($config.PATH).replace(/\/\.\//g, '\/')
var $fullFunctionPath = ($config.PATH).replace(/\/\.\//g, '/')
} else {
var $fullFunctionPath = (process.cwd() + '/' + $configPath + '/' + $config.PATH).replace(/\/\.\//g, '\/')
var $fullFunctionPath = (process.cwd() + '/' + $configPath + '/' + $config.PATH).replace(/\/\.\//g, '/')
}

if ($fullFunctionPath.substr(-1) !== '/')
Expand Down Expand Up @@ -466,7 +466,6 @@ Lambda.prototype.invoke = function( program ) {

Lambda.prototype.start = function( program ) {

var fs = require('fs');
var l = new Lambda( { exitOnError: false } )
var config = l._parse_config_file( program )
var config_path = path.resolve( program );
Expand Down

0 comments on commit beb967a

Please sign in to comment.