Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
append trailing slash to path in loadData
Browse files Browse the repository at this point in the history
  • Loading branch information
kessler committed Jun 28, 2013
1 parent f4361aa commit f9e0cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/loadData.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ function loadData(datastore, credentials, table, path, bucket, gzip, delimiter,
var accessKeyId = credentials.accessKeyId || credentials.AccessKeyId; // here we go, upper lower case crap
var secretAccessKey = credentials.secretAccessKey || credentials.SecretAccessKey;

if (path[0] !== '/')
if (path.length >= 1 && path[0] !== '/')
path = '/' + path;

if (path.length > 1 && path.substr(-1) !== '/')
path += '/';

var fullPath = 's3://' + bucket + path;

var query = 'copy ' + table + ' from \'' + fullPath + '\' ';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redshift-cli",
"version": "0.0.11",
"version": "0.0.12",
"description": "command line for querying and managing a redshift cluster",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit f9e0cf8

Please sign in to comment.