Skip to content

Commit d7e2d4b

Browse files
author
bimalkjha
committed
fix for issue #208
1 parent f4587f0 commit d7e2d4b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

installer/driverInstall.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
var fs = require('fs');
66
var url = require('url');
7-
var http = require('http');
7+
var http = require('https');
88
var os = require('os');
99
var path = require('path');
1010
var exec = require('child_process').exec;
1111

12-
var installerURL = 'http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/';
12+
var installerURL = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli';
1313
var CURRENT_DIR = process.cwd();
1414
var DOWNLOAD_DIR = path.resolve(CURRENT_DIR, 'installer');
1515
var INSTALLER_FILE;
@@ -31,7 +31,6 @@ var download_file_httpget = function(file_url) {
3131
var IBM_DB_HOME, IBM_DB_INCLUDE, IBM_DB_LIB, IBM_DB_DIR;
3232

3333
if(platform == 'win32') {
34-
3534
if(arch == 'x64') {
3635
var BUILD_FILE = path.resolve(CURRENT_DIR, 'build.zip');
3736
readStream = fs.createReadStream(BUILD_FILE);
@@ -220,7 +219,11 @@ var download_file_httpget = function(file_url) {
220219
}
221220
data.copy( buf, byteIndex );
222221
byteIndex += data.length;
222+
process.stdout.write((platform == 'win32') ? "\033[0G": "\r");
223+
process.stdout.write("Downloaded " + (100.0 * byteIndex / fileLength).toFixed(2) +
224+
"% (" + byteIndex + " bytes)");
223225
}).on('end', function() {
226+
console.log("\n");
224227
if( byteIndex != buf.length )
225228
{
226229
console.log( "Error downloading IBM ODBC and CLI Driver from " +
@@ -254,7 +257,7 @@ var download_file_httpget = function(file_url) {
254257
else
255258
{
256259
var targz = require('targz');
257-
var compress = targz.decompress({src: INSTALLER_FILE, dest: "DOWNLOAD_DIR"}, function(err){
260+
var compress = targz.decompress({src: INSTALLER_FILE, dest: DOWNLOAD_DIR}, function(err){
258261
if(err) {
259262
console.log(err);
260263
process.exit(1);
@@ -294,7 +297,7 @@ var download_file_httpget = function(file_url) {
294297
if(platform == 'darwin' && arch == 'x64')
295298
{
296299
// Run the install_name_tool
297-
var nameToolCommand = "install_name_tool -change libdb2.dylib $IBM_DB_HOME/lib/libdb2.dylib ./build/Release/odbc_bindings.node"
300+
var nameToolCommand = "install_name_tool -change libdb2.dylib $IBM_DB_HOME/lib/libdb2.dylib ./build/Release/odbc_bindings.node" ;
298301
var nameToolCmdProcess = exec(nameToolCommand ,
299302
function (error1, stdout1, stderr1) {
300303
if (error1 !== null) {
@@ -341,7 +344,7 @@ var download_file_httpget = function(file_url) {
341344
{
342345
var options = {
343346
host: url.parse(installerfileURL).host,
344-
port: 80,
347+
port: 443,
345348
path: url.parse(installerfileURL).pathname
346349
};
347350
var proxyStr;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "IBM DB2 and IBM Informix bindings for node",
44
"version": "1.0.2",
55
"main": "lib/odbc.js",
6-
"homepage": "http://github.com/ibmdb/node-ibm_db/",
6+
"homepage": "https://github.com/ibmdb/node-ibm_db/",
77
"repository": {
88
"type": "git",
99
"url": "git://github.com/ibmdb/node-ibm_db.git"

0 commit comments

Comments
 (0)