/
githubmirror
/
dive
Обзор
Документация
Войти
/
githubmirror
/
dive
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.11.0
cmd/ci.go
37 строк
676 B
Alex Goodman
Rework CI validation workflow and makefile (#460)
07 июл 2023, 05:01
Не верифицирован
07 июл 2023, 05:01
d5e8a92
Код
Авторство
О чём код?
package cmd import ( "bytes" "fmt" "os" "strconv" "github.com/spf13/viper" ) func configureCi() (bool, *viper.Viper, error) { isCiFromEnv, _ := strconv.ParseBool(os.Getenv("CI")) isCi = isCi || isCiFromEnv if isCi { ciConfig.SetConfigType("yaml") if _, err := os.Stat(ciConfigFile); !os.IsNotExist(err) { fmt.Printf(" Using CI config: %s\n", ciConfigFile) fileBytes, err := os.ReadFile(ciConfigFile) if err != nil { return isCi, nil, err } err = ciConfig.ReadConfig(bytes.NewBuffer(fileBytes)) if err != nil { return isCi, nil, err } } else { fmt.Println(" Using default CI config") } } return isCi, ciConfig, nil }