Skip to content

Commit

Permalink
Merge pull request #14 from warrensbox/master
Browse files Browse the repository at this point in the history
Merging bug fix to master relates to #11
  • Loading branch information
warrensbox authored May 28, 2018
2 parents 8c176af + b63ca50 commit a0c17ea
Show file tree
Hide file tree
Showing 11 changed files with 422 additions and 424 deletions.
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

<img style="text-allign:center" src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/smallerlogo.png" alt="drawing" width="120" height="130"/>

<!-- ![gopher](https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/logo.png =100x20) -->

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:

<img src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/tfswitch.gif" alt="drawing" style="width: 180px;"/>

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)



Expand Down
5 changes: 3 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -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]
39 changes: 16 additions & 23 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="The tfswitch command line tool lets you switch between different versions of terraform.">

{% seo %}
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
Expand All @@ -14,46 +15,38 @@
<body>
<div class="wrapper">
<header>
<h1 style="font-size:25px;"><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repository_name }}</a></h1>

{% if site.logo %}
<img src="{{site.logo | relative_url}}" alt="Logo" />
{% endif %}
<!-- <h1 style="font-size:25px;"><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repository_name }}</a></h1> -->
<!-- <h1 style="font-size:25px; text-align: center"><a href="{{ "/" | absolute_url }}">tfswitch</a></h1> -->

<p align="center">
<img align="middle" src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/logo.png" alt="Logo" />
</p>

<p>{{ site.description | default: site.github.project_tagline }}</p>
<p style="text-align: center">{{ site.description | default: site.github.project_tagline }}</p>
<!-- <p>Written in go</p> -->
<img src="https://travis-ci.org/warrensbox/terraform-switcher.svg?branch=master" alt="Travis" />
<img src="https://goreportcard.com/badge/github.com/warrensbox/terraform-switcher" alt="Go Report" />

<hr style="margin-top: 20px;">
{% if site.github.is_project_page %}
<p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub <small>{{ site.github.repository_nwo }}</small></a></p>
{% endif %}



{% if site.github.is_user_page %}
<p class="view"><a href="{{ site.github.owner_url }}">View My GitHub Profile</a></p>
{% endif %}

{% if site.show_downloads %}
<ul>
<li><a href="{{ site.github.zip_url }}">Download <strong>MacOS</strong></a></li>
<li><a href="{{ site.github.tar_url }}">Download <strong>Linux</strong></a></li>
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
<li><a href="https://github.com/warrensbox/terraform-switcher/releases/download/{{ site.github.releases[0].tag_name }}/terraform-switcher_{{ site.github.releases[0].tag_name }}_darwin_amd64.tar.gz">Download <strong>MacOS</strong></a></li>
<li><a href="https://github.com/warrensbox/terraform-switcher/releases/download/{{ site.github.releases[0].tag_name }}/terraform-switcher_{{ site.github.releases[0].tag_name }}_linux_amd64.tar.gz">Download <strong>Linux</strong></a></li>
<li><a href="https://github.com/warrensbox/terraform-switcher/releases">Releases On <strong>GitHub</strong></a></li>
</ul>
{% endif %}
</header>
<section>

{{ content }}

{% if site.github.is_project_page %}
<p><small>VERSION: {{ site.github.releases[0].tag_name }}. This project is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></small></p>
{% endif %}
</section>
<footer>
{% if site.github.is_project_page %}
<p>This project is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
{% endif %}
<p><small>View other products &mdash; by <a href="http://warren.veerasingam.com/#about_me">Warren Veerasingam</a></small></p>
<p><small>View other products &mdash; by <a href="http://warren.veerasingam.com/#about_me" target="_blank">Warren Veerasingam</a></small></p>

</footer>
</div>
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
Expand Down
112 changes: 112 additions & 0 deletions docs/_site/additional.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="The tfswitch command line tool lets you switch between different versions of terraform.">

<!-- Begin Jekyll SEO tag v2.4.0 -->
<title>tfswitch | The tfswitch command line tool lets you switch between different versions of terraform</title>
<meta name="generator" content="Jekyll v3.7.3" />
<meta property="og:title" content="tfswitch" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="The tfswitch command line tool lets you switch between different versions of terraform" />
<meta property="og:description" content="The tfswitch command line tool lets you switch between different versions of terraform" />
<link rel="canonical" href="http://localhost:4000/additional.html" />
<meta property="og:url" content="http://localhost:4000/additional.html" />
<meta property="og:site_name" content="tfswitch" />
<script type="application/ld+json">
{"description":"The tfswitch command line tool lets you switch between different versions of terraform","@type":"WebPage","url":"http://localhost:4000/additional.html","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"http://localhost:4000/assets/img/logo.png"}},"headline":"tfswitch","@context":"http://schema.org"}</script>
<!-- End Jekyll SEO tag -->

<link rel="stylesheet" href="/assets/css/style.css?v=6896e1e3b55581482a0f3e7780e98a0bb16b8d71">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<!-- <h1 style="font-size:25px;"><a href="http://localhost:4000/">tfswitch</a></h1> -->
<!-- <h1 style="font-size:25px; text-align: center"><a href="http://localhost:4000/">tfswitch</a></h1> -->

<p align="center">
<img align="middle" src="https://s3.us-east-2.amazonaws.com/kepler-images/warrensbox/logo.png" alt="Logo" />
</p>

<p style="text-align: center">The tfswitch command line tool lets you switch between different versions of terraform</p>
<!-- <p>Written in go</p> -->
<img src="https://travis-ci.org/warrensbox/terraform-switcher.svg?branch=master" alt="Travis" />
<img src="https://goreportcard.com/badge/github.com/warrensbox/terraform-switcher" alt="Go Report" />

<hr style="margin-top: 20px;">


<ul>
<li><a href="https://github.com/warrensbox/terraform-switcher/releases/download/0.3.256/terraform-switcher_0.3.256_darwin_amd64.tar.gz">Download <strong>MacOS</strong></a></li>
<li><a href="https://github.com/warrensbox/terraform-switcher/releases/download/0.3.256/terraform-switcher_0.3.256_linux_amd64.tar.gz">Download <strong>Linux</strong></a></li>
<li><a href="https://github.com/warrensbox/terraform-switcher/releases">Releases On <strong>GitHub</strong></a></li>
</ul>

</header>
<section>


<p><a href="index">Back to main</a></p>

<h2 id="upgrade">Upgrade:</h2>

<h3 id="homebrew">Homebrew</h3>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">brew</span> <span class="n">upgrade</span> <span class="n">warrensbox</span><span class="o">/</span><span class="n">tap</span><span class="o">/</span><span class="n">tfswitch</span>
</code></pre></div></div>
<h3 id="linux">Linux</h3>

<p>Rerun:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-L</span> https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash
</code></pre></div></div>

<h2 id="uninstall">Uninstall:</h2>

<h3 id="homebrew-1">Homebrew</h3>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">brew</span> <span class="n">uninstall</span> <span class="n">warrensbox</span><span class="o">/</span><span class="n">tap</span><span class="o">/</span><span class="n">tfswitch</span>
</code></pre></div></div>
<h3 id="linux-1">Linux</h3>

<p>Rerun:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rm /usr/local/bin/tfswitch
</code></pre></div></div>

<h2 id="troubleshoot">Troubleshoot:</h2>

<p>Common issues:</p>
<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="ss">install: </span><span class="n">can</span><span class="err">'</span><span class="n">t</span> <span class="n">change</span> <span class="n">permissions</span> <span class="n">of</span> <span class="sr">/usr/</span><span class="n">local</span><span class="o">/</span><span class="ss">bin: </span><span class="no">Operation</span> <span class="n">not</span> <span class="n">permitted</span>
</code></pre></div></div>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="s2">"Unable to remove symlink. You must have SUDO privileges"</span>
</code></pre></div></div>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="s2">"Unable to create symlink. You must have SUDO privileges"</span>
</code></pre></div></div>
<p>You probably need to have <strong>sudo</strong> privileges to install <em>tfswitch</em>.</p>

<p><a href="#upgrade">Back to top</a> <br />
<a href="index">Back to main</a></p>


<p><small>VERSION: 0.3.256. This project is maintained by <a href="http://github.com/warrensbox">warrensbox</a></small></p>

</section>
<footer>
<p><small>View other products &mdash; by <a href="http://warren.veerasingam.com/#about_me" target="_blank">Warren Veerasingam</a></small></p>

</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>

</body>
</html>
51 changes: 51 additions & 0 deletions docs/_site/additional.md
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit a0c17ea

Please sign in to comment.