Skip to content

Commit

Permalink
fix(buildout): fix remote URL parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
iseki0 committed Dec 19, 2024
2 parents c934b90 + bfbb14d commit e5f2cff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions module/python/buildout/parsingFiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NoCurrentDirectoryCfg(ctx context.Context, NowPath string, path string, res
if filepath.Dir(path) == NowPath {
return nil
}
if strings.Contains(path, "http") {
if strings.Contains(path, "http://") || strings.Contains(path, "https://") {
resp, err := http.Get(path)
if err != nil {
log.Error("http get failed", zap.Error(err))
Expand All @@ -61,7 +61,6 @@ func NoCurrentDirectoryCfg(ctx context.Context, NowPath string, path string, res
return e
}
} else {
// 如果不是远程连接 则尝试打开读取
extends, e = parseBuildoutCfgFile(ctx, path, result)
if e != nil {
return e
Expand All @@ -77,8 +76,8 @@ func findVersionsFile(ctx context.Context, path string, result map[string]string
var log = logctx.Use(ctx).Sugar()
var extends string
var e error
// 如果事远程链接 则读取
if strings.Contains(path, "http") {
// 如果是远程链接 则读取
if strings.Contains(path, "http://") || strings.Contains(path, "https://") {
resp, err := http.Get(path)
if err != nil {
log.Error("http get failed", zap.Error(err))
Expand All @@ -95,7 +94,7 @@ func findVersionsFile(ctx context.Context, path string, result map[string]string
return e
}
} else {
// 如果不是远程连接 则尝试打开读取
// 如果不是远程链接 则尝试打开读取
extends, e = parseBuildoutCfgFile(ctx, path, result)
if e != nil {
return e
Expand Down Expand Up @@ -139,6 +138,7 @@ func parseBuildoutCfgFile(ctx context.Context, path string, result map[string]st
log.Error("Fail to read file: ", zap.Error(err))
return "", err
}

for _, section := range cfg.Sections() {
if section.Name() == "version" || section.Name() == "dependencies" || section.Name() == "versions" {
for _, key := range section.Keys() {
Expand Down

0 comments on commit e5f2cff

Please sign in to comment.