Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 committed Oct 23, 2024
2 parents 4ad84c2 + c4db935 commit 7bc3b3c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion artifactory/services/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (rs *RepositoriesService) GetWithFilter(params RepositoriesFilterParams) (*
// This function is used to create the URL for the repositories API with the given filter params.
// The function expects to get a RepositoriesFilterParams struct that contains the desired filter params.
// The function returns the URL string.
func (rs *RepositoriesService)createUrlWithFilter(params RepositoriesFilterParams) string {
func (rs *RepositoriesService) createUrlWithFilter(params RepositoriesFilterParams) string {
u := url.URL{
Path: apiRepositories,
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/gookit/color v1.5.4
github.com/jfrog/archiver/v3 v3.6.1
github.com/jfrog/build-info-go v1.10.2
github.com/jfrog/build-info-go v1.10.3
github.com/jfrog/gofrog v1.7.6
github.com/minio/sha256-simd v1.0.1
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jfrog/archiver/v3 v3.6.1 h1:LOxnkw9pOn45DzCbZNFV6K0+6dCsQ0L8mR3ZcujO5eI=
github.com/jfrog/archiver/v3 v3.6.1/go.mod h1:VgR+3WZS4N+i9FaDwLZbq+jeU4B4zctXL+gL4EMzfLw=
github.com/jfrog/build-info-go v1.10.2 h1:RCCBsahRNYOm3W7Z9tAL/ixBLzrOzm4mTgI2N6jvqsw=
github.com/jfrog/build-info-go v1.10.2/go.mod h1:JcISnovFXKx3wWf3p1fcMmlPdt6adxScXvoJN4WXqIE=
github.com/jfrog/build-info-go v1.10.3 h1:9nqBdZD6xkuxiOvxg+idZ79QLFWQNuucvKkl8Xb42kw=
github.com/jfrog/build-info-go v1.10.3/go.mod h1:JcISnovFXKx3wWf3p1fcMmlPdt6adxScXvoJN4WXqIE=
github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s=
github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Expand Down
2 changes: 1 addition & 1 deletion tests/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func init() {
XrayUrl = flag.String("xr.url", "", "Xray url")
XscUrl = flag.String("xsc.url", "", "Xsc url")
PipelinesUrl = flag.String("pipe.url", "", "Pipelines url")
AccessUrl = flag.String("access.url", "http://localhost:8081/access", "Access url")
AccessUrl = flag.String("access.url", "http://127.0.0.1:8082/access", "Access url")
RtUser = flag.String("rt.user", "admin", "Artifactory username")
RtPassword = flag.String("rt.password", "password", "Artifactory password")
AccessToken = flag.String("access.token", testUtils.GetLocalArtifactoryTokenIfNeeded(*RtUrl), "Access token")
Expand Down
22 changes: 20 additions & 2 deletions utils/log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ var stdErrIsTerminal *bool
// but through the 'colorsSupported' function.
var colorsSupported *bool

// Determines whether to not remove emojis from the output. This variable should not be accessed directly,
// but through the 'IsEmojiAllow' function.
var allowEmojis bool

// defaultLogger is the default logger instance in case the user does not set one
var defaultLogger = NewLogger(INFO, nil)

Expand Down Expand Up @@ -189,11 +193,13 @@ func (logger jfrogLogger) Output(a ...interface{}) {
}

func (logger *jfrogLogger) Println(log *log.Logger, isTerminal bool, values ...interface{}) {
// Remove emojis from all strings if it's not a terminal or if the terminal is not supporting colors
// If not requested, remove emojis from all strings if it's not a terminal or if the terminal is not supporting colors
if !(IsColorsSupported() && isTerminal) {
for i, value := range values {
if str, ok := value.(string); ok {
if gomoji.ContainsEmoji(str) {
if allowEmojis {
values[i] = str
} else if gomoji.ContainsEmoji(str) {
values[i] = gomoji.RemoveEmojis(str)
}
}
Expand Down Expand Up @@ -249,6 +255,18 @@ func SetIsTerminalFlagsWithCallback(isTerminal bool) func() {
}
}

func IsEmojiAllow() bool {
return allowEmojis
}

func SetAllowEmojiFlagWithCallback(allow bool) func() {
prevAllowEmojis := allowEmojis
allowEmojis = allow
return func() {
allowEmojis = prevAllowEmojis
}
}

func IsColorsSupported() bool {
if colorsSupported == nil {
supported := true
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
const (
Development = "development"
Agent = "jfrog-client-go"
Version = "1.47.2"
Version = "1.47.3"
)

type MinVersionProduct string
Expand Down

0 comments on commit 7bc3b3c

Please sign in to comment.