Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ if (commandTypes.indexOf(process.argv[2]) == -1) {
process.exit(1);
}

var path = require('path');
var dotenv = require('dotenv');
var lambda = require('../lib/main.js');
var lambda = require(path.join(__dirname, '..', 'lib', 'main.js'));
var program = require('commander');
var fs = require('fs');
var packageJson = fs.existsSync(process.cwd() + '/package.json') ?
require(process.cwd() + '/package.json') : {};
var packageJson = fs.existsSync(path.join(process.cwd(), 'package.json')) ?
require(path.join(process.cwd(), 'package.json')) : {};
var packageJsonName = packageJson.name || 'UnnamedFunction';

dotenv.load();
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Lambda.prototype._zip = function (program, codeDirectory, callback) {
.on('data', function (file) {
if (!file.stats.isDirectory()) {
var content = fs.readFileSync(file.path);
var filePath = file.path.replace(codeDirectory + '/', '');
var filePath = file.path.replace(path.join(codeDirectory, path.sep), '');
zip.file(filePath, content);
}
})
Expand Down