Skip to content

Commit

Permalink
Merge pull request #36 from playground/install-sh
Browse files Browse the repository at this point in the history
add support for macOS uninstallHorizon
  • Loading branch information
playground authored Feb 8, 2022
2 parents b28febb + 29390a3 commit 9e82e3e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion build/common/src/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/common/src/utils.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hzn-cli",
"version": "0.2.20",
"version": "0.2.21",
"description": "Open Horizon CLI toolkit helps streamline the process of preparing node agents and perform tasks between orgs environments",
"main": "./build/index.js",
"bin": {
Expand Down
6 changes: 5 additions & 1 deletion src/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ export class Utils {
console.log(`\nWould you like to proceed to uninstall Horzion: Y/n?`)
prompt.get({name: 'answer', required: true}, (err: any, question: any) => {
if(question.answer.toUpperCase() === 'Y') {
this.shell(`sudo apt purge -y bluehorizon horizon horizon-cli`)
let arg = `sudo apt purge -y bluehorizon horizon horizon-cli`
if(process.platform == 'darwin') {
arg = `yes | sudo /Users/Shared/horizon-cli/bin/horizon-cli-uninstall.sh && sudo pkgutil --forget com.github.open-horizon.pkg.horizon-cli`
}
this.shell(arg)
.subscribe({
complete: () => {
this.shell(`rm -rf ${this.homePath}/.hzn`)
Expand Down

0 comments on commit 9e82e3e

Please sign in to comment.