format Unix

This commit is contained in:
admju
2024-09-02 11:44:44 +00:00
parent 11f56722f7
commit 9cf954776f
24 changed files with 1097 additions and 1097 deletions

View File

@@ -1,41 +1,41 @@
package tool
import (
"fmt"
"os"
"path/filepath"
log "oc-deploy/log_wrapper"
"oc-deploy/utils"
"oc-deploy/kubectl"
)
type KubecltInstallData struct {
obj ToolData
}
func (this KubecltInstallData) Get() (ToolData) {
return this.obj
}
func (this KubecltInstallData) Download() (error) {
bin_dir := this.obj.Bin
bin := filepath.Join(bin_dir, this.obj.Name)
url := fmt.Sprintf(this.obj.Url, this.obj.Version)
log.Log().Debug().Msg(fmt.Sprintf("Téléchargement : %s, %s", bin, url))
os.MkdirAll(bin_dir, os.ModePerm)
err := utils.DownloadFromUrl(bin, url, 0777)
if err != nil {return err}
os.Chmod(bin, 0755)
return nil
}
///////////////
func (this KubecltInstallData) Version(path string) (string, error) {
return kubectl.Version(path)
}
package tool
import (
"fmt"
"os"
"path/filepath"
log "oc-deploy/log_wrapper"
"oc-deploy/utils"
"oc-deploy/kubectl"
)
type KubecltInstallData struct {
obj ToolData
}
func (this KubecltInstallData) Get() (ToolData) {
return this.obj
}
func (this KubecltInstallData) Download() (error) {
bin_dir := this.obj.Bin
bin := filepath.Join(bin_dir, this.obj.Name)
url := fmt.Sprintf(this.obj.Url, this.obj.Version)
log.Log().Debug().Msg(fmt.Sprintf("Téléchargement : %s, %s", bin, url))
os.MkdirAll(bin_dir, os.ModePerm)
err := utils.DownloadFromUrl(bin, url, 0777)
if err != nil {return err}
os.Chmod(bin, 0755)
return nil
}
///////////////
func (this KubecltInstallData) Version(path string) (string, error) {
return kubectl.Version(path)
}