Skip to content

Commit 37ca253

Browse files
authored
Merge pull request #112 from IBM-Cloud/1208
Remove idt and uninstaller. Add ic shortcut for "ibmcloud"
2 parents 2d36167 + d57d72b commit 37ca253

5 files changed

Lines changed: 39 additions & 220 deletions

File tree

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ The following command will install the IBM Cloud Developer Tools in a single inv
2222
$ curl -sL https://ibm.biz/idt-installer | bash
2323
```
2424

25-
Once complete, there will be three shortcuts defined to access the IBM Cloud Developer Tools:
26-
- `idt` : Main command line tool
27-
- `idt update` : Update your IBM Cloud Developer Tools to the latest versions
28-
- `idt uninstall` : Uninstall the IBM Cloud Developer Tools
25+
Once complete, there will be a shortcut defined to access the IBM Cloud CLI:
26+
- `ic` : Shortcut for the 'ibmcloud' command
27+
2928

3029
Access the [platform-specific readme](./linux-installer/README.md) for additional details.
3130

linux-installer/README.md

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ $ curl -sL https://ibm.biz/idt-installer | bash
3737

3838
Once complete, there will be three added shortcuts defined to access the IDT:
3939
- `ibmcloud dev` : Main command line tool for IBM cloud native development
40-
- `ibmcloud dev update` : Update your IDT environment to the latest versions
41-
- `ibmcloud dev uninstall` : Uninstall the IBM Developer Tools
40+
- `ibmcloud update` : Update your IBM Cloud CLI to the latest version
41+
- `ibmcloud plugin update` : Update IBM Cloud plugins to the latest versions
4242

4343

4444
### Debugging
@@ -49,44 +49,21 @@ If you have any issues with the installer, try running with the `--trace` argume
4949
curl -sL https://ibm.biz/idt-installer | bash -s -- --trace
5050
```
5151

52-
If updating an existing IDT installation, you can run the following:
52+
If you wish to update the IBM Cloud Dev Plugin, run:
5353
```
54-
idt update --trace
54+
ibmcloud plugin update dev
5555
```
5656

5757

5858
## Updating
5959

60-
If you wish to update the IBM Developer Tools CLI, run `ibmcloud dev update`. There is also a `--force` argument that will force update to all dependencies too.
60+
If you wish to update the IBM Cloud Dev Plugin, run `ibmcloud plugin update dev`.
6161

6262
Syntax:
6363
```
64-
ibmcloud dev update [--force] [--trace]
64+
ibmcloud plugin update dev
6565
```
6666

67-
This command is simply an alias defined during initial install that runs the installer shown here:
68-
69-
```
70-
$ curl -sL https://ibm.biz/idt-installer | bash -c -- [--force]
71-
```
72-
73-
74-
## Uninstall
75-
76-
If you wish to remove the IBM Developer Tools CLI, run `ibmcloud dev uninstall`.
77-
78-
Syntax:
79-
```
80-
ibmcloud dev uninstall [--trace]
81-
```
82-
83-
This command is simply an alias defined during install that runs the following:
84-
85-
```
86-
$ curl -sL https://ibm.biz/idt-installer | bash -c -- uninstall
87-
```
88-
89-
9067

9168
## Pre-Requisites
9269

@@ -103,7 +80,6 @@ Usage: idt-installer [<args>]
10380
10481
Where <args> is:
10582
install | update [Default] Perform full install (or update) of all needed CLIs and Plugins
106-
uninstall Uninstall full IBM Cloud CLI env, including 'ibmcloud', and plugins
10783
help | -h | -? Show this help
10884
--force Force updates of dependencies and other settings during update
10985
--trace Eanble verbose tracing of all activity
@@ -114,12 +90,8 @@ If "install" (or no action provided), a full CLI installation (or update) will o
11490
2. Install latest IBM Cloud 'ibmcloud' CLI
11591
3. Install all required plugins
11692
4. Defines aliases to improve useability
117-
- idt : Shortcut for normal "ibmcloud dev" command
118-
- idt update : Runs this installer checking for and installing any updates
119-
- idt uninstall : Uninstalls IDT, including the 'ibmcloud cli' and all plugins
93+
- ic : Shortcut for "ibmcloud" command
12094
121-
If "uninstall", the IBM Cloud CLI and plugins are removed from the system, including personal metadata.
122-
Note: Pre-req CLIs listed above are NOT uninstalled.
12395
12496
Chat with us on Slack: https://slack-invite-ibm-cloud-tech.mybluemix.net/
12597
Submit any issues to : https://github.com/IBM-Cloud/ibm-cloud-developer-tools/issues

linux-installer/idt-installer

Lines changed: 7 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function help {
2525
2626
Where <args> is:
2727
install [Default] Perform full install (or update) of all needed CLIs and Plugins
28-
uninstall Uninstall full IBM Cloud CLI env, including 'bx', and plugins
2928
help | -h | -? Show this help
3029
--force Force updates of dependencies and other settings during update
3130
--trace Eanble verbose tracing of all activity
@@ -34,10 +33,6 @@ function help {
3433
1. Pre-req check for 'git', 'docker', 'kubectl', and 'helm'
3534
2. Install latest IBM Cloud 'bx' CLI
3635
3. Install all required plugins
37-
4. Defines 'idt' shortcut to improve useability.
38-
- idt : Shortcut for normal "bx dev" command
39-
- idt update : Runs this installer checking for and installing any updates
40-
- idt uninstall : Uninstalls IDT, 'bx' cli, and all plugins
4136
4237
Chat with us on Slack: ${SLACK_URL}, channel #developer-tools
4338
Submit any issues to : ${GIT_URL}/issues
@@ -82,53 +77,9 @@ function prompt {
8277
#-- Use $REPLY to get user's input
8378
}
8479

85-
#------------------------------------------------------------------------------
86-
function uninstall {
87-
if [[ -t 0 ]]; then #-- are we in a terminal?
88-
echo
89-
prompt "Please confirm you want to uninstall IBM Cloud Developer Tools (y/N)?"
90-
if [[ "$REPLY" != [Yy]* ]]; then
91-
log "Uninstall aborted at user request"
92-
return
93-
fi
94-
fi
95-
warn "Starting Uninstall..."
96-
[ "$SUDO" ] && log "You may be prompted for 'sudo' password."
97-
98-
#-- Run the following regardless
99-
$SUDO rm -f /usr/local/bin/bluemix
100-
$SUDO rm -f /usr/local/bin/bx
101-
$SUDO rm -f /usr/local/bin/bluemix-analytics
102-
$SUDO rm -rf /usr/local/Bluemix
103-
#-- Taken from bluemix CLI brew uninstaller
104-
if [[ -f /etc/profile ]]; then
105-
$SUDO sed -E -i ".bluemix_uninstall_bak" \
106-
-e '/^### Added by the Bluemix CLI$/d' \
107-
-e '/^source \/usr\/local\/Bluemix\/bx\/bash_autocomplete$/d' \
108-
/etc/profile
109-
fi
110-
if [[ -f ~/.bashrc ]]; then
111-
sed -E -i ".bluemix_uninstall_bak" \
112-
-e '/^### Added by the Bluemix CLI$/d' \
113-
-e '/^source \/usr\/local\/Bluemix\/bx\/bash_autocomplete$/d' \
114-
~/.bashrc
115-
fi
116-
if [[ -f ~/.zshrc ]]; then
117-
sed -E -i ".bluemix_uninstall_bak" \
118-
-e '/^### Added by the Bluemix CLI$/d' \
119-
-e '/^source \/usr\/local\/Bluemix\/bx\/zsh_autocomplete$/d' \
120-
~/.zshrc
121-
fi
122-
env_setup remove
123-
124-
rm -rf ~/.bluemix
125-
126-
log "Uninstall finished."
127-
}
128-
12980
#------------------------------------------------------------------------------
13081
function install {
131-
if [[ -n "$(which idt)" ]]; then
82+
if [[ -n "$(which bx)" ]]; then
13283
log "Starting Installation..."
13384
else
13485
log "Starting Update..."
@@ -372,7 +323,7 @@ function install_plugins {
372323
"sdk-gen"
373324
)
374325

375-
log "Installing/updating IBM Cloud CLI plugins used by IDT..."
326+
log "Installing/updating IBM Cloud CLI plugins..."
376327
for plugin in "${PLUGINS[@]}"; do
377328
log "Checking status of plugin: ${plugin}"
378329
read -r p ver <<< "$(bx plugin list | grep "^${plugin} ")"
@@ -391,14 +342,14 @@ function install_plugins {
391342

392343
#------------------------------------------------------------------------------
393344
function env_setup {
394-
idt_prog="/usr/local/bin/idt"
395345
env_file=""
396346

397347
if [[ -f ~/.bashrc ]] ; then env_file=~/.bashrc
398348
elif [[ -f ~/.bash_profile ]]; then env_file=~/.bash_profile
399349
elif [[ -f ~/.profile ]] ; then env_file=~/.profile
400350
fi
401351

352+
402353
#-- Clear up any old aliases
403354
if [[ -n "$(grep 'alias idt="bx dev"' "$env_file")" ]]; then
404355
log "Removing old 'idt' aliases from: ${env_file}"
@@ -412,44 +363,10 @@ function env_setup {
412363
warn "Symptom is: running 'idt update' results in 'update is not a defined command'."
413364
fi
414365

415-
if [[ "$1" == "add" ]]; then
416-
idt_launch_ver=$(grep "# Version:" /usr/local/bin/idt 2>/dev/null | cut -d':' -f2)
417-
if [[ ! -f "$idt_prog" || "$FORCE" == true || "${idt_launch_ver}" != "$VERSION" ]]; then
418-
cat <<-!!EOF > ~/idt
419-
#!/bin/bash
420-
#-----------------------------------------------------------
421-
# IBM Cloud Developer Tools (IDT)
422-
# Version:${VERSION}
423-
# Wrapper for the 'bx dev' command, and external helpers.
424-
#-----------------------------------------------------------
425-
# Syntax:
426-
# idt - Run 'bx dev <args>'
427-
# idt update [--trace] [--force] - Update IDT and deps
428-
# idt uninstall [--trace] - Uninstall IDT
429-
#-----------------------------------------------------------
430-
if [[ "\$1" == "update" || "\$1" == "uninstall" ]]; then
431-
echo "IDT launcher action: \$1"
432-
tmp=\$(mktemp -d 2>/dev/null || mktemp -d -t 'idttmpdir')
433-
echo "Fetching latest installer to: \$tmp/idt-installer"
434-
curl -sL https://ibm.biz/idt-installer -o \$tmp/idt-installer
435-
bash -- \$tmp/idt-installer \$*
436-
rm -r \$tmp
437-
else
438-
bx dev \$*
439-
fi
440-
#-----------------------------------------------------------
441-
!!EOF
442-
$SUDO mv ~/idt $idt_prog
443-
$SUDO chmod 755 $idt_prog
444-
log "The following shortcuts defined to access the IBM Cloud Developer Tools CLI:"
445-
log " ${GRN}idt${NRM} : Main command, shorthand for '${CYN}bx dev${NRM}'"
446-
log " ${GRN}idt update${NRM} : Update your IBM Cloud Developer Tools to the latest version"
447-
log " ${GRN}idt uninstall${NRM} : Uninstall the IBM Cloud Developer Tools"
448-
fi
449-
elif [[ "$1" == "remove" ]]; then
450-
$SUDO rm -f $idt_prog
451-
else
452-
error "Internal error - called with invalid parameter: ${1}"
366+
if [[ "$1" == "add" && $(grep "alias ic=" $env_file) == "" ]]; then
367+
#-- Add alias "ic"
368+
echo 'alias ic="ibmcloud"' >> ${env_file}
369+
warn "Please restart your shell to enable 'ic' alias for ibmcloud!"
453370
fi
454371
}
455372

@@ -489,7 +406,6 @@ function main {
489406
;;
490407
"update") ACTION="install";;
491408
"install") ACTION="install";;
492-
"uninstall") ACTION="uninstall";;
493409
"help") ACTION="help";;
494410
esac
495411
shift
@@ -516,7 +432,6 @@ function main {
516432
case "$ACTION" in
517433
"") install;;
518434
"install") install;;
519-
"uninstall") uninstall;;
520435
*) help;;
521436
esac
522437

windows-installer/README.md

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Summary
1717

18-
PowerShell script that downloads and installs the IBM Cloud Developer Tools (IDT) CLI Plugin and all of its dependencies on Windows 10 or newer systems. The IDT consists of the 'dev' (and several other) plugins to the IBM Cloud CLI. Our general target environment is the IBM Cloud, including public, dedicated, and local hybrid.
18+
PowerShell script that downloads and installs the IBM Cloud CLI, plugins and all of its dependencies on Windows 10 or newer systems. The CLI consists of the 'dev' (and several other) plugins to the IBM Cloud CLI. Our general target environment is the IBM Cloud, including public, dedicated, and local hybrid.
1919

2020

2121
## Installation
@@ -29,10 +29,8 @@ This action will install (or update) the IBM Cloud Developer Tools to your windo
2929
Set-ExecutionPolicy Unrestricted; iex(New-Object Net.WebClient).DownloadString('http://ibm.biz/idt-win-installer')
3030
```
3131

32-
Once the installation has completed, and you have rebooted your system (as needed), there will be three added shortcuts defined to access the IDT:
33-
- `ibmcloud dev` : Main command line tool for IBM cloud native development
34-
- `ibmcloud dev update` : Update your IDT environment to the latest versions
35-
- `ibmcloud dev uninstall` : Uninstall the IBM Developer Tools
32+
Once the installation has completed, and you have rebooted your system (as needed), there will be an added shortcut defined to access the IBM Cloud cli:
33+
- `ic`: shortcut for the `ibmcloud` command
3634

3735

3836
### Running from Download
@@ -56,9 +54,9 @@ Set-ExecutionPolicy Unrestricted
5654
.\idt-win-installer.ps1 --trace
5755
```
5856

59-
If updating an existing IDT installation, you can run the following:
57+
If updating an existing IBM Cloud CLI installation, you can run the following:
6058
```
61-
ibmcloud dev update --trace
59+
ibmcloud update
6260
```
6361

6462

@@ -67,31 +65,15 @@ ibmcloud dev update --trace
6765
If you wish to update the IBM Developer Tools CLI, run:
6866

6967
```
70-
ibmcloud dev update [--force] [--trace]
68+
ibmcloud plugin update dev
7169
```
7270

73-
The `--force` argument that will force update to all dependencies too.
74-
7571
This command is simply a shortcut defined during initial install that runs (in admin mode) the installer as shown here:
7672

7773
```
7874
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Unrestricted ""iex(New-Object Net.WebClient).DownloadString(""""http://ibm.biz/idt-win-installer"""")"" ""%2"" ""%3"" ' -Verb RunAs}"
7975
```
8076

81-
## Uninstall
82-
83-
If you wish to remove the IBM Developer Tools CLI, run:
84-
85-
```
86-
ibmcloud dev uninstall [--trace]
87-
```
88-
89-
This command is simply a shortcut defined during install that runs (in admin mode) the installer's uninstall action as shown here:
90-
91-
```
92-
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Unrestricted ""iex(New-Object Net.WebClient).DownloadString(""""http://ibm.biz/idt-win-installer"""")"" ""uninstall"" ""%2"" ' -Verb RunAs}"
93-
```
94-
9577

9678
## Pre-Requisites
9779

@@ -108,7 +90,6 @@ Usage: idt-win-installer [<args>]
10890
10991
Where <args> is:
11092
install | update [Default] Perform full install (or update) of all needed CLIs and Plugins
111-
uninstall Uninstall full IBM Cloud CLI env, including 'ibmcloud', and plugins
11293
help | -h | -? Show this help
11394
--force Force updates of dependencies and other settings during update
11495
--trace Eanble verbose tracing of all activity
@@ -119,12 +100,8 @@ If "install" (or no action provided), a full CLI installation (or update) will o
119100
2. Install latest IBM Cloud 'ibmcloud' CLI
120101
3. Install all required plugins
121102
4. Defines aliases to improve useability
122-
- idt : Shortcut for normal "ibmcloud dev" command
123-
- idt update : Runs this installer checking for and installing any updates
124-
- idt uninstall : Uninstalls IDT, including the 'ibmcloud cli' and all plugins
103+
- ic : Shortcut for "ibmcloud" command
125104
126-
If "uninstall", the IBM Cloud CLI and plugins are removed from the system, including personal metadata.
127-
Note: Pre-req CLIs listed above are NOT uninstalled.
128105
129106
Chat with us on Slack: https://slack-invite-ibm-cloud-tech.mybluemix.net/
130107
Submit any issues to : https://github.com/IBM-Cloud/ibm-cloud-developer-tools/issues

0 commit comments

Comments
 (0)