Skip to content

Commit

Permalink
Merge pull request #4 from ecowden/path-join
Browse files Browse the repository at this point in the history
Mac- & Linix-friendly paths
  • Loading branch information
bchr02 committed Mar 25, 2016
2 parents d21976c + 2b84ffb commit a2d428c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions instantclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var fs = require("fs");
var Readline = require('readline');
var ic_config = require('./instantclient_config.json');
var ic_packages = ['basic','sdk'];
var dir = process.cwd() + '\\' + ic_config.folder;
var dir = path.join(process.cwd(), ic_config.folder);
var username;
var password;
var oam_req;
Expand Down Expand Up @@ -102,7 +102,7 @@ var credentialsPrompt = function(){
}
});
};

console.log('');
console.log('You must have an Oracle Account to continue.');
console.log('You can register for a free account here: https://profile.oracle.com/myprofile/account/create-account.jspx');
Expand Down Expand Up @@ -181,7 +181,7 @@ var createFolder = function() {
ic_packages.forEach(function(pkg){downloadPkg(pkg);});
});
};

if(fs.existsSync(dir)){
console.log('');
console.log('Directory (' + ic_config.folder + ') already exists!');
Expand All @@ -207,10 +207,10 @@ var createFolder = function() {
var downloadPkg = function(pkg) {
var fileObj = ic_config[ic_config.defaultversion][process.platform][process.arch][pkg];
var fn = fileObj.fn;
var fullPathToFile = dir + '\\' + fn;
var fullPathToFile = path.join(dir, fn);
var url = ic_config[ic_config.defaultversion][process.platform][process.arch][pkg].url;
var fileStream = fs.createWriteStream(fullPathToFile);

request({
url: url,
method: 'GET',
Expand Down Expand Up @@ -261,4 +261,4 @@ var downloadPkg = function(pkg) {
});
};

agreementPrompt();
agreementPrompt();

0 comments on commit a2d428c

Please sign in to comment.