Skip to content
Open
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: 5 additions & 2 deletions dist/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ const extractToLib = exports.extractToLib = file => {
} else {
_rimraf2.default.sync(extractDir);
_fsExtra2.default.mkdirSync(extractDir);
return Promise.resolve(extractDir);
}

if (_path2.default.extname(file) === ".zip") {
Expand All @@ -203,7 +202,8 @@ const extractToLib = exports.extractToLib = file => {
}
});
});
} else {
}
else if (_path2.default.extname(file) === ".tar") {
return new Promise((resolve, reject) => {
(0, _child_process.spawn)("tar", ["zxf", file], {
cwd: extractDir,
Expand All @@ -218,6 +218,9 @@ const extractToLib = exports.extractToLib = file => {
});
});
}
else {
return Promise.resolve(extractDir);
}
};

/**
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/sgraham785/flywaydb-cli.git"
"url": "git+https://github.com/jitterbox/flywaydb-cli.git"
},
"keywords": [
"flyway",
Expand All @@ -28,9 +28,9 @@
"author": "Sean Graham",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/sgraham785/flywaydb-cli/issues"
"url": "https://github.com/jitterbox/flywaydb-cli/issues"
},
"homepage": "https://github.com/sgraham785/flywaydb-cli#readme",
"homepage": "https://github.com/jitterbox/flywaydb-cli#readme",
"dependencies": {
"extract-zip": "^1.6.5",
"filesize": "^3.5.9",
Expand Down
15 changes: 8 additions & 7 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,11 @@ export const extractToLib = file => {
} else {
rimraf.sync(extractDir);
fs.mkdirSync(extractDir);
return Promise.resolve(extractDir);
}

if (path.extname(file) === ".zip") {
return new Promise((resolve, reject) => {
extractZip(file, { dir: extractDir }, err => {
return new Promise(function(resolve, reject) {
extractZip(file, { dir: extractDir }, function(err) {
if (err) {
console.error("Error extracting zip", err);
reject(new Error("Error extracting zip"));
Expand All @@ -183,12 +182,12 @@ export const extractToLib = file => {
}
});
});
} else {
return new Promise((resolve, reject) => {
spawn("tar", ["zxf", file], {
} else if (path.extname(file) === ".tar") {
return new Promise(function(resolve, reject) {
child_process.spawn("tar", ["zxf", file], {
cwd: extractDir,
stdio: "inherit"
}).on("close", code => {
}).on("close", function(code) {
if (code === 0) {
resolve(extractDir);
} else {
Expand All @@ -197,6 +196,8 @@ export const extractToLib = file => {
}
});
});
} else {
return Promise.resolve(extractDir);
}
};

Expand Down