Skip to content

Commit baa8534

Browse files
authored
Remove additional deprecated code for v2 (#154)
* Adapt to API changes in gocmd * Remove additional deprecated code for v2
1 parent 6387363 commit baa8534

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

common/commands/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (cc *ConfigCommand) Config() error {
156156
}
157157

158158
func (cc *ConfigCommand) configRefreshableToken() {
159-
if (cc.details.User == "" || cc.details.Password == "") {
159+
if cc.details.User == "" || cc.details.Password == "" {
160160
return
161161
}
162162
// Set the default interval for the refreshable tokens to be initialized in the next CLI run.

common/spec/specfiles.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
clientutils "github.com/jfrog/jfrog-client-go/utils"
1111
"github.com/jfrog/jfrog-client-go/utils/errorutils"
1212
"github.com/jfrog/jfrog-client-go/utils/io/fileutils"
13-
"github.com/jfrog/jfrog-client-go/utils/log"
1413
)
1514

1615
type SpecFiles struct {
@@ -153,7 +152,7 @@ func ValidateSpec(files []File, isTargetMandatory, isSearchBasedSpec, isUpload b
153152
if len(files) == 0 {
154153
return errors.New("Spec must include at least one file group")
155154
}
156-
propsUsedInUpload := false
155+
157156
for _, file := range files {
158157
isAql := len(file.Aql.ItemsFind) > 0
159158
isPattern := len(file.Pattern) > 0
@@ -168,7 +167,6 @@ func ValidateSpec(files []File, isTargetMandatory, isSearchBasedSpec, isUpload b
168167
isOffset := file.Offset > 0
169168
isLimit := file.Limit > 0
170169
isValidSortOrder := file.SortOrder == "asc" || file.SortOrder == "desc"
171-
propsUsedInUpload = propsUsedInUpload || (isUpload && len(file.Props) > 0)
172170
isExcludeProps := len(file.ExcludeProps) > 0
173171
isArchive := len(file.Archive) > 0
174172
isValidArchive := file.Archive == "zip"
@@ -234,17 +232,9 @@ func ValidateSpec(files []File, isTargetMandatory, isSearchBasedSpec, isUpload b
234232
return errors.New("The value of 'archive' (if provided) must be 'zip'.")
235233
}
236234
}
237-
if propsUsedInUpload {
238-
showDeprecationOnProps()
239-
}
240235
return nil
241236
}
242237

243238
func fileSpecValidationError(fieldA, fieldB string) error {
244239
return errors.New(fmt.Sprintf("Spec cannot include both '%s' and '%s.'", fieldA, fieldB))
245240
}
246-
247-
func showDeprecationOnProps() {
248-
log.Warn(`The --props command option and the 'Props' File Spec property are deprecated in Upload.
249-
Please use the --target-props command option or the 'targetProps' File Spec property instead.`)
250-
}

general/cisetup/utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ const (
3232
passResult = "PASS"
3333
failResult = "FAIL"
3434

35-
urlFlag = "url"
36-
rtUrlFlag = "artifactory-url"
37-
userFlag = "user"
35+
urlFlag = "url"
36+
rtUrlFlag = "artifactory-url"
37+
userFlag = "user"
3838

3939
// Replace exe (group 2) with "jfrog rt exe" while maintaining preceding (if any) and succeeding spaces.
4040
mvnGradleRegexp = `(^|\s)(mvn|gradle)(\s)`

utils/coreutils/utils.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ func ReplaceVars(content []byte, specVars map[string]string) []byte {
206206
}
207207

208208
func GetJfrogHomeDir() (string, error) {
209-
// The JfrogHomeEnv environment variable has been deprecated and replaced with HomeDir
210209
if os.Getenv(HomeDir) != "" {
211210
return os.Getenv(HomeDir), nil
212211
}

0 commit comments

Comments
 (0)