@@ -11,6 +11,7 @@ import (
1111 "strings"
1212
1313 "github.com/agnivade/levenshtein"
14+ "github.com/jfrog/build-info-go/flexpack"
1415 gofrogcmd "github.com/jfrog/gofrog/io"
1516 artifactoryCLI "github.com/jfrog/jfrog-cli-artifactory/cli"
1617 "github.com/jfrog/jfrog-cli-core/v2/common/build"
@@ -133,7 +134,7 @@ func execMain() error {
133134 if err = setUberTraceIdToken (); err != nil {
134135 clientlog .Warn ("failed generating a trace ID token:" , err .Error ())
135136 }
136- if os . Getenv ( "JFROG_RUN_NATIVE" ) == "true" {
137+ if flexpack . IsFlexPackEnabled () {
137138 // If the JFROG_RUN_NATIVE environment variable is set to true, we run the new implementation
138139 // but only for package manager commands, not for JFrog CLI commands
139140 args := ctx .Args ()
@@ -155,7 +156,7 @@ func execMain() error {
155156
156157 app .CommandNotFound = func (c * cli.Context , command string ) {
157158 // Try to handle as native package manager command only when JFROG_RUN_NATIVE is true
158- if os . Getenv ( "JFROG_RUN_NATIVE" ) == "true" && isPackageManagerCommand (command ) {
159+ if flexpack . IsFlexPackEnabled () && isPackageManagerCommand (command ) {
159160 clientlog .Debug ("Attempting to handle as native package manager command:" , command )
160161 err := runNativeImplementation (c )
161162 if err != nil {
@@ -194,7 +195,7 @@ func execMain() error {
194195 if err == nil {
195196 displaySurveyLinkIfNeeded ()
196197 // Exit normally if native implementation ran successfully
197- if os . Getenv ( "JFROG_RUN_NATIVE" ) == "true" && len (args ) > 1 && isPackageManagerCommand (args [1 ]) {
198+ if flexpack . IsFlexPackEnabled () && len (args ) > 1 && isPackageManagerCommand (args [1 ]) {
198199 // Only exit if we're not in a test environment
199200 if ! isTestEnvironment () {
200201 os .Exit (0 )
0 commit comments