From 7c30b1c806cf10deb4f189af5e0a825ab8bdebe5 Mon Sep 17 00:00:00 2001 From: lihan Date: Thu, 16 May 2024 10:08:44 +0800 Subject: [PATCH] perf: no changes, no need to refresh environment. fix #273 --- cmd/commands/env.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/commands/env.go b/cmd/commands/env.go index 457f06a4..57c976dc 100644 --- a/cmd/commands/env.go +++ b/cmd/commands/env.go @@ -136,6 +136,10 @@ func envFlag(ctx *cli.Context) error { exportEnvs[k] = v } + // No changes, no need to refresh environment. + if sdkCurrentPaths.Len() == 0 { + return nil + } osPaths := env.NewPaths(env.OsPaths) sdkCurrentPaths.Merge(osPaths) pathsStr := sdkCurrentPaths.String()