tfv 1.7.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/lib/modules/use.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,9 +29,12 @@ npm i -g tfv
|
|
|
29
29
|
* [list](#list)
|
|
30
30
|
<!--te-->
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
https://user-images.githubusercontent.com/25563661/142188036-4f2a8b65-1a3e-4298-95e0-9ed533c66a18.mp4
|
|
33
35
|
|
|
34
36
|
### Modules
|
|
37
|
+
|
|
35
38
|
#### *install*
|
|
36
39
|
```sh
|
|
37
40
|
tfv install <version>
|
|
@@ -40,12 +43,12 @@ or
|
|
|
40
43
|
```sh
|
|
41
44
|
tfv i <version>
|
|
42
45
|
```
|
|
43
|
-
| Version | Description
|
|
44
|
-
| ---------------- |
|
|
45
|
-
| x.x.x | Installs terraform version x.x.x
|
|
46
|
-
| x^ | Installs latest version of
|
|
47
|
-
| x.x.^ | Installs latest version of
|
|
48
|
-
| latest | Installs latest version of terraform
|
|
46
|
+
| Version | Description |
|
|
47
|
+
| ---------------- | ------------------------------------------ |
|
|
48
|
+
| x.x.x | Installs terraform version x.x.x |
|
|
49
|
+
| x^ | Installs latest version of release x |
|
|
50
|
+
| x.x.^ | Installs latest version of release x.x |
|
|
51
|
+
| latest | Installs latest version of terraform |
|
|
49
52
|
|
|
50
53
|
#### *use*
|
|
51
54
|
```sh
|
package/lib/modules/use.js
CHANGED
|
@@ -47,7 +47,7 @@ exports.use = async (tfVer) => {
|
|
|
47
47
|
const bin = os.platform() === 'darwin' ? '/usr/local/bin' : `${os.homedir()}/bin`;
|
|
48
48
|
|
|
49
49
|
destination = `${bin}/terraform`;
|
|
50
|
-
spawnSync('sudo', ['rm', `${destination}`], {stdio: 'inherit', shell: true});
|
|
50
|
+
if (fs.existsSync(destination)) spawnSync('sudo', ['rm', '-f', `${destination}`], {stdio: 'inherit', shell: true});
|
|
51
51
|
spawnSync('sudo', ['cp', `${source}`, `${destination}`], {stdio: 'inherit', shell: true});
|
|
52
52
|
}
|
|
53
53
|
|