You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `tgswitch` command line tool lets you switch between different versions of [terragrunt](https://www.terragrunt.io/).
10
+
The `tgswitch` command line tool lets you switch between different versions of <ahref="https://terragrunt.gruntwork.io/"target="_blank">terragrunt</a>.
11
11
If you do not have a particular version of terragrunt installed, `tgswitch` will download the version you desire.
12
12
The installation is minimal and easy.
13
13
Once installed, simply select the version you require from the dropdown and start using terragrunt.
14
14
15
-
16
-
See installation guide here: [tgswitch installation](https://warrensbox.github.io/tgswitch/)
17
-
18
-
***Important**
19
-
Please see upcoming changes [Version 0.5](CHANGELOG.md)
20
-
21
15
## Installation
22
16
23
17
`tgswitch` is available for MacOS and Linux based operating systems.
24
18
25
19
### Homebrew
26
20
27
-
Installation for MacOS is the easiest with Homebrew. [If you do not have homebrew installed, click here](https://brew.sh/).
28
-
21
+
Installation for MacOS is the easiest with Homebrew. <ahref="https://brew.sh/"target="_blank">If you do not have homebrew installed, click here</a>.
1. Create a custom binary path. Ex: `mkdir /Users/uveerum/bin` (replace uveerum with your username)
73
+
2. Add the path to your PATH. Ex: `export PATH=$PATH:/Users/uveerum/bin` (add this to your bash profile or zsh profile)
74
+
3. Pass -b or --bin parameter with your custom path to install terragrunt. Ex: `tgswitch -b /Users/uveerum/bin/terragrunt 0.34.0 `
75
+
4. Optionally, you can create a `.tgswitch.toml` file in your terragrunt directory(current directory) OR in your home directory(~/.tgswitch.toml). The toml file in the current directory has a higher precedence than toml file in the home directory
76
+
5. Your `.tgswitch.toml` file should look like this:
77
+
```ruby
78
+
bin ="/usr/local/bin/terragrunt"
79
+
version ="0.34.0"
80
+
```
81
+
4. Run `tgswitch` and it should automatically install the required terragrunt version in the specified binary path
65
82
66
-
1. Create a custom binary path. Ex: `mkdir /Users/warrenveerasingam/bin` (replace warrenveerasingam with your username)
67
-
2. Add the path to your PATH. Ex:`export PATH=$PATH:/Users/warrenveerasingam/bin`(add this to your bash profile or zsh profile)
68
-
3. Pass -b or --bin parameter with your custom path to install terragrunt. Ex: `tgswitch -b /Users/warrenveerasingam/bin/terragrunt 0.14.1 `
83
+
**NOTE**
84
+
1. For linux users that do not have write permission to `/usr/local/bin/`, `tgswitch` will attempt to install terragrunt at `$HOME/bin`. Run`export PATH=$PATH:$HOME/bin` to append bin to PATH
85
+
2. For windows host, `tgswitch` need to be run under `Administrator` mode, and `$HOME/.tgswitch.toml` with `bin` must be defined (with a valid path) as minimum, below is an example for `$HOME/.tgswitch.toml` on windows
69
86
87
+
```toml
88
+
bin = "C:\\Users\\<%USRNAME%>\\bin\\terragrunt.exe"
1. Create a `.tgswitchrc` file containing the desired version
74
-
2. For example, `echo "0.14.1" >> .tgswitchrc` for version 0.14.1 of terragrunt
94
+
2. For example, `echo "0.33.0" >> .tgswitchrc` for version 0.33.0 of terragrunt
75
95
3. Run the command `tgswitch` in the same directory as your `.tgswitchrc`
76
96
77
-
#### *Instead of a `.tgswitchrc` file, a `.terragrunt-version` file may be used for compatibility with [`tgenv`](https://github.com/cunymatthieu/tgenv#terragrunt-version) and other tools which use it*
97
+
*Instead of a `.tgswitchrc` file, a `.terragrunt-version` file may be used as well*
If a terragrunt.hcl file with the terragrunt constrain is included in the current directory, it should automatically download or switch to that terragrunt version. For example, the following should automatically switch terragrunt to version 0.36.0:
0 commit comments