Skip to content

Commit

Permalink
Merge pull request #164 from zeabur/pan93412/zea-2056-fix-zbpack-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 authored Oct 24, 2023
2 parents fcee9e9 + 1b09f90 commit 82726a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 2 additions & 8 deletions internal/dotnet/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ import (
// DetermineFramework is used to determine the Dotnet framework
func DetermineFramework(entryPoint string, src afero.Fs) (string, error) {
fileName := entryPoint + ".csproj"
if utils.HasFile(src, fileName) {
content, err := afero.ReadFile(src, fileName)
if err != nil {
return "", err
}

content, err := afero.ReadFile(src, fileName)
if err == nil {
pattern := regexp.MustCompile(`Project Sdk="(.*?)"`)
// Search for the target framework in the file.
matches := pattern.FindStringSubmatch(string(content))
Expand All @@ -29,8 +25,6 @@ func DetermineFramework(entryPoint string, src afero.Fs) (string, error) {
return string(types.DotnetFrameworkAspnet), nil
} else if strings.Contains(matches[1], "Microsoft.NET.Sdk") {
return string(types.DotnetFrameworkConsole), nil
} else {
return "", errors.New("Unable to determine framework")
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion internal/static/identify.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package static

import (
"github.com/spf13/afero"
"strings"

"github.com/spf13/afero"

"github.com/zeabur/zbpack/internal/utils"
"github.com/zeabur/zbpack/pkg/plan"
"github.com/zeabur/zbpack/pkg/types"
Expand Down

0 comments on commit 82726a6

Please sign in to comment.