Skip to content

Commit

Permalink
Revert "Replaced warrensbox with EliaBracciSumo"
Browse files Browse the repository at this point in the history
This reverts commit a29103a.
Elia Bracci committed Dec 20, 2022
1 parent f6136cc commit e130e0f
Showing 14 changed files with 30 additions and 33 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
docker:
- image: circleci/golang:1.17

working_directory: /go/src/github.com/EliaBracciSumo/tgswitch
working_directory: /go/src/github.com/warrensbox/tgswitch

steps:
- checkout
@@ -24,7 +24,7 @@ jobs:
docker:
- image: circleci/golang:1.17

working_directory: /go/src/github.com/EliaBracciSumo/tgswitch
working_directory: /go/src/github.com/warrensbox/tgswitch

steps:
- checkout
@@ -37,10 +37,10 @@ jobs:
export RELEASE_VERSION;
echo $RELEASE_VERSION
mkdir -p /home/circleci/bin
export PATH="/home/EliaBracciSumo/bin:${PATH}"
export PATH="/home/warrensbox/bin:${PATH}"
rm -rf dist
git config user.email "warren.veerasingam@gmail.com"
git config user.name "EliaBracciSumo"
git config user.name "warrensbox"
git tag -a ${RELEASE_VERSION} -m "Release Version"
git push origin ${RELEASE_VERSION}
curl -L https://git.io/goreleaser | bash
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EXE := tgswitch
PKG := github.com/EliaBracciSumo/tgswitch
VER := $(shell { git ls-remote --tags . 2>/dev/null || git ls-remote --tags git@github.com:EliaBracciSumo/tgswitch.git; } | awk '{if ($$2 ~ "\\^\\{\\}$$") next; print vers[split($$2,vers,"\\/")]}' | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -1)
PKG := github.com/warrensbox/tgswitch
VER := $(shell { git ls-remote --tags . 2>/dev/null || git ls-remote --tags git@github.com:warrensbox/tgswitch.git; } | awk '{if ($$2 ~ "\\^\\{\\}$$") next; print vers[split($$2,vers,"\\/")]}' | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -1)
PATH := build:$(PATH)
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/EliaBracciSumo/tgswitch
module github.com/warrensbox/tgswitch

go 1.16

2 changes: 1 addition & 1 deletion lib/command_test.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/EliaBracciSumo/tgswitch/lib"
"github.com/warrensbox/tgswitch/lib"
)

// TestNewCommand : pass value and check if returned value is a pointer
2 changes: 1 addition & 1 deletion lib/download_test.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
"runtime"
"testing"

lib "github.com/EliaBracciSumo/tgswitch/lib"
lib "github.com/warrensbox/tgswitch/lib"
)

// TestDownloadFromURL_FileNameMatch : Check expected filename exist when downloaded
18 changes: 9 additions & 9 deletions lib/files.go
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ func CheckFileExist(file string) bool {
return true
}

// CreateDirIfNotExist : create directory if directory does not exist
//CreateDirIfNotExist : create directory if directory does not exist
func CreateDirIfNotExist(dir string) {
if _, err := os.Stat(dir); os.IsNotExist(err) {
log.Printf("Creating directory for terragrunt: %v", dir)
@@ -58,7 +58,7 @@ func CreateDirIfNotExist(dir string) {
}
}

// WriteLines : writes into file
//WriteLines : writes into file
func WriteLines(lines []string, path string) (err error) {
var (
file *os.File
@@ -110,7 +110,7 @@ func ReadLines(path string) (lines []string, err error) {
return
}

// IsDirEmpty : check if directory is empty (TODO UNIT TEST)
//IsDirEmpty : check if directory is empty (TODO UNIT TEST)
func IsDirEmpty(name string) bool {

exist := false
@@ -128,7 +128,7 @@ func IsDirEmpty(name string) bool {
return exist // Either not empty or error, suits both cases
}

// CheckDirHasTGBin : // check binary exist (TODO UNIT TEST)
//CheckDirHasTGBin : // check binary exist (TODO UNIT TEST)
func CheckDirHasTGBin(dir, prefix string) bool {

exist := false
@@ -148,9 +148,9 @@ func CheckDirHasTGBin(dir, prefix string) bool {
return exist
}

// CheckDirExist : check if directory exist
// dir=path to file
// return path to directory
//CheckDirExist : check if directory exist
//dir=path to file
//return path to directory
func CheckDirExist(dir string) bool {
if _, err := os.Stat(dir); os.IsNotExist(err) {
return false
@@ -205,11 +205,11 @@ func ReadingFileMsg(filename string) {
fmt.Printf("Reading file %s \n", filename)
}

// retrive file content of regular file
//retrive file content of regular file
func RetrieveFileContents(file string) string {
fileContents, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalf("Error: %s\nFailed to read %s file. Follow the README.md instructions for setup. https://github.com/EliaBracciSumo/tgswitch/blob/master/README.md\n", err, file)
log.Fatalf("Error: %s\nFailed to read %s file. Follow the README.md instructions for setup. https://github.com/warrensbox/tgswitch/blob/master/README.md\n", err, file)
}
tgversion := strings.TrimSuffix(string(fileContents), "\n")
return tgversion
4 changes: 2 additions & 2 deletions lib/files_test.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (
"testing"
"time"

"github.com/EliaBracciSumo/tgswitch/lib"
"github.com/warrensbox/tgswitch/lib"
)

// TestRenameFile : Create a file, check filename exist,
@@ -130,7 +130,7 @@ func TestCreateDirIfNotExist(t *testing.T) {
cleanUp(installLocation)
}

// TestWriteLines : write to file, check readline to verify
//TestWriteLines : write to file, check readline to verify
func TestWriteLines(t *testing.T) {

installPath := "/.terragrunt.versions_test/"
2 changes: 0 additions & 2 deletions lib/install.go
Original file line number Diff line number Diff line change
@@ -225,8 +225,6 @@ func Install(tgversion string, usrBinPath string, mirrorURL string) string {
/* proceed to download it from the hashicorp release page */
url := mirrorURL + "v" + tgversion + "/" + "terragrunt" + "_" + goos + "_" + goarch

fmt.Printf("\n Downloading terragrunt from %s", url)

downloadedFile, errDownload := DownloadFromURL(installLocation, url)

/* If unable to download file from url, exit(1) immediately */
6 changes: 3 additions & 3 deletions lib/list_versions_test.go
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@ import (
"log"
"testing"

"github.com/EliaBracciSumo/tgswitch/lib"
"github.com/warrensbox/tgswitch/lib"
)

const (
gruntURL = "https://api.github.com/repos/gruntwork-io/terragrunt/releases"
)

// TestRemoveDuplicateVersions : test to removed duplicate
//TestRemoveDuplicateVersions : test to removed duplicate
func TestRemoveDuplicateVersions(t *testing.T) {

test_array := []string{"0.0.1", "0.0.2", "0.0.3", "0.0.1"}
@@ -25,7 +25,7 @@ func TestRemoveDuplicateVersions(t *testing.T) {
}
}

// TestValidVersionFormat : test if func returns valid version format
//TestValidVersionFormat : test if func returns valid version format
// more regex testing at https://rubular.com/r/UvWXui7EU2icSb
func TestValidVersionFormat(t *testing.T) {

2 changes: 1 addition & 1 deletion lib/symlink_test.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"os/user"
"testing"

"github.com/EliaBracciSumo/tgswitch/lib"
"github.com/warrensbox/tgswitch/lib"
)

// TestCreateSymlink : check if symlink exist-remove if exist,
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -22,12 +22,12 @@ import (
"path/filepath"
"strings"

lib "github.com/EliaBracciSumo/tgswitch/lib"
"github.com/hashicorp/hcl2/gohcl"
"github.com/hashicorp/hcl2/hclparse"
"github.com/manifoldco/promptui"
"github.com/pborman/getopt"
"github.com/spf13/viper"
lib "github.com/warrensbox/tgswitch/lib"
)

const (
2 changes: 1 addition & 1 deletion test-data/test_terragrunt-version/.terragrunt-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.26.7
0.36.0
3 changes: 1 addition & 2 deletions test-tgswitch.sh
Original file line number Diff line number Diff line change
@@ -76,12 +76,11 @@ function runtestarg(){
commentComplete
}

#runtestdir "terragrunt version" "test_terragrunt-version" "v0.26.7"
runtestdir "terragrunt version" "test_terragrunt-version" "v0.36.0"
runtestdir "terragrunt hcl" "test_terragrunt_hcl" "v0.36.0"
runtestdir "tgswitchrc" "test_tgswitchrc" "v0.33.0"
runtestdir ".toml" "test_tgswitchtoml" "v0.34.0"
runtestenv "env variable" "0.37.1" "v0.37.1"
#runtestenv "env variable" "0.26.7" "v0.26.7"
runtestarg "passing argument" "0.36.1" "v0.36.1"
# M1 darwin arm64 test versions < 0.28.12
runtestdir "terragrunt version" "test_terragrunt-version_m1" "v0.26.7"
6 changes: 3 additions & 3 deletions www/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
site_name: tgswitch
site_description: A command line tool to switch between different versions of terragrunt (install with homebrew and more)
copyright: This project is maintained by EliaBracciSumo
repo_name: EliaBracciSumo/tgswitch
repo_url: https://github.com/EliaBracciSumo/tgswitch
copyright: This project is maintained by warrensbox
repo_name: warrensbox/tgswitch
repo_url: https://github.com/warrensbox/tgswitch
site_url: https://tgswitch.warrensbox.com

theme:

0 comments on commit e130e0f

Please sign in to comment.