@@ -4,27 +4,36 @@ import (
44 gofrogcmd "github.com/jfrog/gofrog/io"
55 "github.com/jfrog/gofrog/version"
66 "github.com/jfrog/jfrog-client-go/utils/errorutils"
7+ "github.com/jfrog/jfrog-client-go/utils/log"
78 "strings"
89)
910
1011const unsupportedYarnVersion = "4.0.0"
1112
1213func IsInstalledYarnVersionSupported (executablePath string ) error {
14+ log .Debug ("Getting version cmd" )
1315 versionGetCmdConfig := getVersionCmdConfig (executablePath )
16+ log .Debug ("Got version cmd" , versionGetCmdConfig )
1417 output , err := gofrogcmd .RunCmdOutput (versionGetCmdConfig )
18+ log .Debug ("Output received " , output )
1519 if err != nil {
20+ log .Debug ("error received " , output )
1621 return errorutils .CheckError (err )
1722 }
1823 yarnVersion := strings .TrimSpace (output )
24+ log .Debug ("yarnVersion: " , yarnVersion )
1925 return IsVersionSupported (yarnVersion )
2026}
2127
2228func IsVersionSupported (versionStr string ) error {
29+ log .Debug ("trying to form a new version" )
2330 yarnVersion := version .NewVersion (versionStr )
31+ log .Debug ("formed a new version: " , yarnVersion )
2432 if yarnVersion .Compare (unsupportedYarnVersion ) <= 0 {
2533 return errorutils .CheckErrorf ("Yarn version 4 is not supported. The current version is: " + versionStr +
2634 ". Please downgrade to a compatible version to continue" )
2735 }
36+ log .Debug ("Successfully compared" )
2837 return nil
2938}
3039
0 commit comments