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 beb967a commit 4529f41
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,20 @@ Lambda.prototype._parse_config_file = function( program ) {
var $configPath = program.split('/').slice(0,-1).join('/')
//console.log( $configPath )

var fullFunctionPath

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

if ($fullFunctionPath.substr(-1) !== '/')
$fullFunctionPath+='/'
if ( fullFunctionPath.substr(-1) !== '/')
fullFunctionPath+='/'

//console.log($fullFunctionPath)

$config.PATH = $fullFunctionPath;
$config.PATH = fullFunctionPath;

return $config;
}
Expand Down Expand Up @@ -155,23 +157,23 @@ Lambda.prototype.deploy = function( program ) {
var tmpfile = path.join( os.tmpdir(), $config.FunctionName + "-" + new Date().getTime() + ".zip" )
var $configPath = program.split('/').slice(0,-1).join('/')


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

if ($fullFunctionPath.substr(-1) !== '/')
$fullFunctionPath+='/'
if (fullFunctionPath.substr(-1) !== '/')
fullFunctionPath+='/'

if (!fs.existsSync($fullFunctionPath)) {
console.log( "No such directory:" + $fullFunctionPath )
if (!fs.existsSync( fullFunctionPath )) {
console.log( "No such directory:" + fullFunctionPath )
process.exit(-1)
}

var $cwd = process.cwd()
process.chdir($fullFunctionPath)
process.chdir( fullFunctionPath )

var zipfileList = '.'

Expand Down

0 comments on commit 4529f41

Please sign in to comment.