diff --git a/README.md b/README.md index b22fc6d9..18270898 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,61 @@ [![Build Status](https://travis-ci.org/warrensbox/terraform-switcher.svg?branch=master)](https://travis-ci.org/warrensbox/terraform-switcher) [![Go Report Card](https://goreportcard.com/badge/github.com/warrensbox/terraform-switcher)](https://goreportcard.com/report/github.com/warrensbox/terraform-switcher) [![CircleCI](https://circleci.com/gh/warrensbox/terraform-switcher/tree/master.svg?style=shield&circle-token=55ddceec95ff67eb38269152282f8a7d761c79a5)](https://circleci.com/gh/warrensbox/terraform-switcher) -# terraform-switcher -#remove this +# Terraform Switcher + +drawing + + + +The `tfswitch` command line tool lets you switch between different versions of [terraform](https://www.terraform.io/). +If you do not have a particular version of terraform installed, `tfswitch` will download the version you desire. +The installation is minimal and easy. +Once installed, simply select the version you require from the dropdown and start using terraform. + +See installation guide here: [tfswitch installation](https://warrensbox.github.io/terraform-switcher/) + +## Installation + +`tfswitch` is available for MacOS and Linux based operating systems. + +### Homebrew + +Installation for MacOS is the easiest with Homebrew. [If you do not have homebrew installed, click here](https://brew.sh/). + + +```ruby +brew install warrensbox/tap/tfswitch +``` + +### Linux + +Installation for other linux operation systems. + +```sh +curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash +``` + +### Install from source + +Alternatively, you can install the binary from source [here](https://github.com/warrensbox/terraform-switcher/releases) + +## How to use: + +drawing + +1. You can switch between different versions of terraform by typing the command `tfswitch` on your terminal. +2. Select the version of terraform you require by using the up and down arrow. +3. Hit **Enter** to select the desired version + +## Additional Info + +See how to *upgrade*, *uninstall*, *troubleshoot* here:[More info](https://warrensbox.github.io/terraform-switcher/additional) + + +## Issues + +Please open *issues* here: [New Issue](https://github.com/warrensbox/terraform-switcher/issues) diff --git a/docs/_config.yml b/docs/_config.yml index 62674304..05e2b0a9 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,8 +1,9 @@ theme: jekyll-theme-minimal -github: [metadata] +#github: [metadata] repository: warrensbox/terraform-switcher logo: /assets/img/logo.png +title: tfswitch show_downloads: true -github: [metadata] +#github: [metadata] diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index ded16043..10a114c6 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -4,6 +4,7 @@ + {% seo %} @@ -14,46 +15,38 @@
-

{{ site.title | default: site.github.repository_name }}

- - {% if site.logo %} - Logo - {% endif %} + + + +

+ Logo +

-

{{ site.description | default: site.github.project_tagline }}

+

{{ site.description | default: site.github.project_tagline }}

Travis Go Report
- {% if site.github.is_project_page %} -

View the Project on GitHub {{ site.github.repository_nwo }}

- {% endif %} - - - - {% if site.github.is_user_page %} -

View My GitHub Profile

- {% endif %} {% if site.show_downloads %} {% endif %}
{{ content }} - + {% if site.github.is_project_page %} +

VERSION: {{ site.github.releases[0].tag_name }}. This project is maintained by {{ site.github.owner_name }}

+ {% endif %}
diff --git a/docs/_site/additional.html b/docs/_site/additional.html new file mode 100644 index 00000000..ad99776c --- /dev/null +++ b/docs/_site/additional.html @@ -0,0 +1,112 @@ + + + + + + + + + +tfswitch | The tfswitch command line tool lets you switch between different versions of terraform + + + + + + + + + + + + + + + +
+
+ + + +

+ Logo +

+ +

The tfswitch command line tool lets you switch between different versions of terraform

+ + Travis + Go Report + +
+ + + + +
+
+ + +

Back to main

+ +

Upgrade:

+ +

Homebrew

+ +
brew upgrade warrensbox/tap/tfswitch
+
+

Linux

+ +

Rerun:

+ +
curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash
+
+ +

Uninstall:

+ +

Homebrew

+ +
brew uninstall warrensbox/tap/tfswitch
+
+

Linux

+ +

Rerun:

+ +
rm /usr/local/bin/tfswitch
+
+ +

Troubleshoot:

+ +

Common issues:

+
install: can't change permissions of /usr/local/bin: Operation not permitted
+
+ +
"Unable to remove symlink. You must have SUDO privileges"
+
+ +
"Unable to create symlink. You must have SUDO privileges"
+
+

You probably need to have sudo privileges to install tfswitch.

+ +

Back to top
+Back to main

+ + +

VERSION: 0.3.256. This project is maintained by warrensbox

+ +
+ +
+ + + + \ No newline at end of file diff --git a/docs/_site/additional.md b/docs/_site/additional.md new file mode 100644 index 00000000..36174332 --- /dev/null +++ b/docs/_site/additional.md @@ -0,0 +1,51 @@ + +[Back to main](index) + +## Upgrade: + +### Homebrew + +```ruby +brew upgrade warrensbox/tap/tfswitch +``` +### Linux + +Rerun: + +```sh +curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash +``` + +## Uninstall: + +### Homebrew + +```ruby +brew uninstall warrensbox/tap/tfswitch +``` +### Linux + +Rerun: + +```sh +rm /usr/local/bin/tfswitch +``` + +## Troubleshoot: + +Common issues: +```ruby +install: can't change permissions of /usr/local/bin: Operation not permitted +``` + +```ruby +"Unable to remove symlink. You must have SUDO privileges" +``` + +```ruby +"Unable to create symlink. You must have SUDO privileges" +``` +You probably need to have **sudo** privileges to install *tfswitch*. + +[Back to top](#upgrade) +[Back to main](index) \ No newline at end of file diff --git a/docs/_site/index.html b/docs/_site/index.html index 69d4338e..cf9794d2 100644 --- a/docs/_site/index.html +++ b/docs/_site/index.html @@ -4,22 +4,23 @@ + -Terraform Switcher | terraform-switcher +Terraform Switcher | tfswitch - - + + - + +{"name":"tfswitch","description":"The tfswitch command line tool lets you switch between different versions of terraform","@type":"WebSite","url":"http://localhost:4000/","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"http://localhost:4000/assets/img/logo.png"}},"headline":"Terraform Switcher","@context":"http://schema.org"} - + @@ -27,29 +28,25 @@
-

terraform-switcher

- - - Logo - + + + +

+ Logo +

-

The tfswitch command lets you switch between terraform versions

+

The tfswitch command line tool lets you switch between different versions of terraform

Travis Go Report
- - - - -
@@ -57,138 +54,65 @@

terraform-switcher<

Terraform Switcher

-

Often times, we work with different versions -of terraform for multiple projects. The tfswitch -command lets you switch different versions of the terraform installation on your computer. The installation is minimal and -easy. Simply select the version you require from the dropdown and -start using terraform with ease.

- -

You can find the source code for Minima at GitHub: -jekyll / -minima

- -

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

- -

hello

-

hello

-

hello

- -

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

- -

You can find the source code for Minima at GitHub: -jekyll / -minima

- -

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

+

The tfswitch command line tool lets you switch between different versions of terraform. +If you do not have a particular version of terraform installed, tfswitch will download the version you desire. +The installation is minimal and easy. +Once installed, simply select the version you require from the dropdown and start using terraform.

-

hello

-

hello

-

hello

+
-

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

+

Installation

-

You can find the source code for Minima at GitHub: -jekyll / -minima

+

tfswitch is available for MacOS and Linux based operating systems.

-

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

+

Homebrew

-

hello

-

hello

-

hello

+

Installation for MacOS is the easiest with Homebrew. If you do not have homebrew installed, click here.

-

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

+
brew install warrensbox/tap/tfswitch
+
-

You can find the source code for Minima at GitHub: -jekyll / -minima

+

Linux

-

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

+

Installation for Linux operation systems.

-

hello

-

hello

-

hello

+
curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash
+
-

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

+

Install from source

-

You can find the source code for Minima at GitHub: -jekyll / -minima

+

Alternatively, you can install the binary from the source here

-

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

+
-

hello

-

hello

-

hello

+

How to use:

-

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

+

drawing

-

You can find the source code for Minima at GitHub: -jekyll / -minima

+
    +
  1. You can switch between different versions of terraform by typing the command tfswitch on your terminal.
  2. +
  3. Select the version of terraform you require by using the up and down arrow.
  4. +
  5. Hit Enter to select the desired version
  6. +
-

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

+
-

hello

-

hello

-

hello

+

Issues

-

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

- -

You can find the source code for Minima at GitHub: -jekyll / -minima

- -

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

- -

hello

-

hello

-

hello

- -

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

- -

You can find the source code for Minima at GitHub: -jekyll / -minima

- -

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

- -

hello

-

hello

-

hello

- -

This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.com

- -

You can find the source code for Minima at GitHub: -jekyll / -minima

- -

You can find the source code for Jekyll at GitHub: -jekyll / -jekyll

+

Please open issues here: New Issue

+
+

See how to upgrade, uninstall, troubleshoot here: +Additional Info

+ +

VERSION: 0.3.256. This project is maintained by warrensbox

+
diff --git a/docs/_site/index.md b/docs/_site/index.md index 05f98718..6f296339 100644 --- a/docs/_site/index.md +++ b/docs/_site/index.md @@ -1,154 +1,54 @@ # Terraform Switcher -Often times, we work with different versions -of terraform for multiple projects. The tfswitch -command lets you switch different versions of the terraform installation on your computer. The installation is minimal and -easy. Simply select the version you require from the dropdown and -start using terraform with ease. +The `tfswitch` command line tool lets you switch between different versions of [terraform](https://www.terraform.io/){:target="_blank"}. +If you do not have a particular version of terraform installed, `tfswitch` will download the version you desire. +The installation is minimal and easy. +Once installed, simply select the version you require from the dropdown and start using terraform. -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +
-You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +## Installation +`tfswitch` is available for MacOS and Linux based operating systems. -[jekyll-organization]: https://github.com/jekyll +### Homebrew -## hello -## hello -## hello +Installation for MacOS is the easiest with Homebrew. [If you do not have homebrew installed, click here](https://brew.sh/){:target="_blank"}. -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +```ruby +brew install warrensbox/tap/tfswitch +``` -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +### Linux +Installation for Linux operation systems. -[jekyll-organization]: https://github.com/jekyll +```sh +curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash +``` -## hello -## hello -## hello +### Install from source -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) +Alternatively, you can install the binary from the source [here](https://github.com/warrensbox/terraform-switcher/releases) -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +
-You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +## How to use: +drawing -[jekyll-organization]: https://github.com/jekyll +1. You can switch between different versions of terraform by typing the command `tfswitch` on your terminal. +2. Select the version of terraform you require by using the up and down arrow. +3. Hit **Enter** to select the desired version -## hello -## hello -## hello +
-This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) +## Issues -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +Please open *issues* here: [New Issue](https://github.com/warrensbox/terraform-switcher/issues){:target="_blank"} -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +
- -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll +See how to *upgrade*, *uninstall*, *troubleshoot* here: +[Additional Info](additional) \ No newline at end of file diff --git a/docs/additional.md b/docs/additional.md new file mode 100644 index 00000000..36174332 --- /dev/null +++ b/docs/additional.md @@ -0,0 +1,51 @@ + +[Back to main](index) + +## Upgrade: + +### Homebrew + +```ruby +brew upgrade warrensbox/tap/tfswitch +``` +### Linux + +Rerun: + +```sh +curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash +``` + +## Uninstall: + +### Homebrew + +```ruby +brew uninstall warrensbox/tap/tfswitch +``` +### Linux + +Rerun: + +```sh +rm /usr/local/bin/tfswitch +``` + +## Troubleshoot: + +Common issues: +```ruby +install: can't change permissions of /usr/local/bin: Operation not permitted +``` + +```ruby +"Unable to remove symlink. You must have SUDO privileges" +``` + +```ruby +"Unable to create symlink. You must have SUDO privileges" +``` +You probably need to have **sudo** privileges to install *tfswitch*. + +[Back to top](#upgrade) +[Back to main](index) \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 05f98718..6f296339 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,154 +1,54 @@ # Terraform Switcher -Often times, we work with different versions -of terraform for multiple projects. The tfswitch -command lets you switch different versions of the terraform installation on your computer. The installation is minimal and -easy. Simply select the version you require from the dropdown and -start using terraform with ease. +The `tfswitch` command line tool lets you switch between different versions of [terraform](https://www.terraform.io/){:target="_blank"}. +If you do not have a particular version of terraform installed, `tfswitch` will download the version you desire. +The installation is minimal and easy. +Once installed, simply select the version you require from the dropdown and start using terraform. -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +
-You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +## Installation +`tfswitch` is available for MacOS and Linux based operating systems. -[jekyll-organization]: https://github.com/jekyll +### Homebrew -## hello -## hello -## hello +Installation for MacOS is the easiest with Homebrew. [If you do not have homebrew installed, click here](https://brew.sh/){:target="_blank"}. -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +```ruby +brew install warrensbox/tap/tfswitch +``` -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +### Linux +Installation for Linux operation systems. -[jekyll-organization]: https://github.com/jekyll +```sh +curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash +``` -## hello -## hello -## hello +### Install from source -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) +Alternatively, you can install the binary from the source [here](https://github.com/warrensbox/terraform-switcher/releases) -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +
-You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +## How to use: +drawing -[jekyll-organization]: https://github.com/jekyll +1. You can switch between different versions of terraform by typing the command `tfswitch` on your terminal. +2. Select the version of terraform you require by using the up and down arrow. +3. Hit **Enter** to select the desired version -## hello -## hello -## hello +
-This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) +## Issues -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) +Please open *issues* here: [New Issue](https://github.com/warrensbox/terraform-switcher/issues){:target="_blank"} -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) +
- -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll - -## hello -## hello -## hello - -This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/) - -You can find the source code for Minima at GitHub: -[jekyll][jekyll-organization] / -[minima](https://github.com/jekyll/minima) - -You can find the source code for Jekyll at GitHub: -[jekyll][jekyll-organization] / -[jekyll](https://github.com/jekyll/jekyll) - - -[jekyll-organization]: https://github.com/jekyll +See how to *upgrade*, *uninstall*, *troubleshoot* here: +[Additional Info](additional) \ No newline at end of file diff --git a/lib/symlink.go b/lib/symlink.go index 154d8485..efe545fc 100644 --- a/lib/symlink.go +++ b/lib/symlink.go @@ -20,12 +20,12 @@ func RemoveSymlink(symlinkPath string) { _, err := os.Lstat(symlinkPath) if err != nil { - log.Fatal("Unable to remove symlink. You must have SUDO privileges") + log.Fatalf("Unable to find symlink. You must have SUDO privileges - %v \n", err) panic(err) } else { errRemove := os.Remove(symlinkPath) if errRemove != nil { - log.Fatal("Unable to remove symlink. You must have SUDO privileges") + log.Fatalf("Unable to remove symlink. You must have SUDO privileges - %v \n", err) panic(errRemove) } } diff --git a/main.go b/main.go index b9b90bea..8f645b7f 100644 --- a/main.go +++ b/main.go @@ -144,8 +144,15 @@ func main() { /* if selected version already exist, */ if fileExist { - /* remove current symlink and set new symlink to desired version */ - lib.RemoveSymlink(installedBinPath) + /* remove current symlink if exist*/ + exist := lib.CheckFileExist(installedBinPath) + + if !exist { + fmt.Println("Symlink does not exist") + } else { + fmt.Printf("Symlink exist") + lib.RemoveSymlink(installedBinPath) + } /* set symlink to desired version */ lib.CreateSymlink(installLocation+installVersion+version, installedBinPath) @@ -176,8 +183,15 @@ func main() { /* remove zipped file to clear clutter */ lib.RemoveFiles(installLocation + installVersion + version + "_" + goos + "_" + goarch + ".zip") - /* remove current symlink and set new symlink to desired version */ - lib.RemoveSymlink(installedBinPath) + /* remove current symlink if exist*/ + exist := lib.CheckFileExist(installedBinPath) + + if !exist { + fmt.Println("Symlink does not exist") + } else { + fmt.Printf("Symlink exist") + lib.RemoveSymlink(installedBinPath) + } /* set symlink to desired version */ lib.CreateSymlink(installLocation+installVersion+version, installedBinPath)