Skip to content

Commit

Permalink
Clidriver Dowload location updated to support go1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilravuri1 committed Mar 5, 2021
1 parent e3012b6 commit 148e5a4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions installer/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func downloadFile(filepath string, url string) error {
out, err := os.Create(filepath)
out, err := os.Create("../../" + filepath)
if err != nil {
return err
}
Expand All @@ -31,7 +31,7 @@ func downloadFile(filepath string, url string) error {
}

func Unzipping(sourcefile string, targetDirectory string) {
reader, err := zip.OpenReader(sourcefile)
reader, err := zip.OpenReader("./../../" + sourcefile)
if err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down Expand Up @@ -66,7 +66,7 @@ func Unzipping(sourcefile string, targetDirectory string) {

func linux_untar(clidriver string, targetDirectory string) error {
fmt.Printf("Extracting with tar -xvzf %s -C %s\n", clidriver, targetDirectory)
out, err := exec.Command("tar", "xvzf", clidriver, "-C", targetDirectory).Output()
out, err := exec.Command("tar", "xvzf", "./../../"+clidriver, "-C", targetDirectory).Output()

fmt.Println(string(out))
if err != nil {
Expand All @@ -79,18 +79,18 @@ func linux_untar(clidriver string, targetDirectory string) error {

func aix_untar(clidriver string, targetDirectory string) error {
fmt.Printf("Extracting with gunzip %s \n", clidriver)
gunzipOut, err := exec.Command("gunzip", clidriver).Output()
gunzipOut, err := exec.Command("gunzip", "./../../"+clidriver).Output()

fmt.Println(string(gunzipOut))
if err != nil {
fmt.Println("Error while running gunzip: " + err.Error())
return err
}

clidriver = strings.TrimRight(clidriver, ".gz")

fmt.Printf("Extracting with tar -xvf %s -C %s\n", clidriver, targetDirectory)
tarOut, err := exec.Command("tar", "xvf", clidriver, "-C", targetDirectory).Output()
tarOut, err := exec.Command("tar", "xvf", "./../../"+clidriver, "-C", targetDirectory).Output()

fmt.Println(string(tarOut))
if err != nil {
Expand Down Expand Up @@ -119,7 +119,7 @@ func main() {
if len(os.Args) == 2 {
target = os.Args[1]
} else {
target = "./"
target = "./../.."
}

if _, err := os.Stat(target + "/clidriver"); !os.IsNotExist(err) {
Expand Down

0 comments on commit 148e5a4

Please sign in to comment.