Skip to content
Permalink
Browse files

Merge pull request #48 from austincunningham/add-4.3

Add 4.3
  • Loading branch information
austincunningham committed Feb 21, 2020
2 parents 95c125d + a95a85f commit 1f9e977c735b53be8b4c91dd186cdf05fe226cfc
Showing with 10 additions and 5 deletions.
  1. +2 −0 CHANGELOG.md
  2. +1 −0 README.md
  3. +1 −1 package-lock.json
  4. +1 −1 package.json
  5. +1 −1 src/change.js
  6. +3 −1 src/download.js
  7. +1 −1 src/extract.js
@@ -16,6 +16,8 @@ Date format YYYY-MM-DD

## [Unreleased]
- ...
## [0.0.29] 2020-02-21
- Add 4.3 binary support
## [0.0.28] 2019-11-04
- Add 4.2 binary support
## [0.0.27] 2019-07-15
@@ -22,6 +22,7 @@ Downloads the compressed oc binary to this module and extracts the various oc ve
|_ 3.11
|_ 4.1
|_ 4.2
|_ 4.3
```

Sets the oc binary to execute by symlinking

Some generated files are not rendered by default. Learn more.

@@ -1,6 +1,6 @@
{
"name": "change_oc",
"version": "0.0.28",
"version": "0.0.29",
"description": "download and change oc version",
"main": "index.js",
"bin": {
@@ -19,7 +19,7 @@ function change(callback) {
console.log(colors.green(stdout));
const version = readlineSync.question(colors.green('What version of oc do you wish to switch to ?'));
// eslint-disable-next-line eqeqeq
if (version != 3.7 && version != 3.9 && version != 3.10 && version != 3.11 && version != 4.1 && version != 4.2) {
if (version != 3.7 && version != 3.9 && version != 3.10 && version != 3.11 && version != 4.1 && version != 4.2 && version != 4.3) {
console.log('Version not present');
} else if (fs.existsSync(`/opt/openshift/${version}`)) {
console.log('Command-line input received:');
@@ -17,7 +17,7 @@ function download_oc() {
console.log(colors.blue('================================= Download OC ======================================='));
const result = readlineSync.question(colors.blue('Do you wish to install an oc binary yes/no ? '));
if (result === 'yes' || result === 'y') {
const version = readlineSync.question(colors.blue('What version of oc do you wish to install ? \n - 3.7\n - 3.9\n - 3.10\n - 3.11\n - 4.1\n - 4.2\n'));
const version = readlineSync.question(colors.blue('What version of oc do you wish to install ? \n - 3.7\n - 3.9\n - 3.10\n - 3.11\n - 4.1\n - 4.2\n - 4.3\n'));
exports.version = version;
switch (version) {
case '3.7':
@@ -38,6 +38,8 @@ function download_oc() {
case '4.2':
url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.2/linux/oc.tar.gz';
break;
case '4.3':
url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.3/linux/oc.tar.gz';
default:
url = false;
console.log(colors.blue('No binary present'));
@@ -25,7 +25,7 @@ const extract_oc = function (callback) {
// move the files and remove the old directory
if (!fs.existsSync(`/opt/openshift/${version}`)) {
// as version 4x tar is not creating same directory structure
if (version !== '4.1' && version != '4.2') {
if (version !== '4.1' && version != '4.2' && version != '4.3') {
const versionpath = `./${version}/${ocpath}${version}*/*`;
exec(`mv ${versionpath} ./${version}`);
exec(`${'rm -rf ./'}${version}/${ocpath}${version}*`);

0 comments on commit 1f9e977

Please sign in to comment.
You can’t perform that action at this time.