File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,19 @@ public static void OverrideEnvironmentVariableToTmp(ParseResult parseResult)
33
33
if ( ! OperatingSystem . IsWindows ( ) && IsRunningUnderSudo ( ) && IsRunningWorkloadCommand ( parseResult ) )
34
34
{
35
35
string sudoHome = PathUtilities . CreateTempSubdirectory ( ) ;
36
- var homeBeforeOverride = Path . Combine ( Environment . GetEnvironmentVariable ( CliFolderPathCalculator . DotnetHomeVariableName ) ) ;
36
+ var homeBeforeOverride = Environment . GetEnvironmentVariable ( CliFolderPathCalculator . DotnetHomeVariableName ) ;
37
37
Environment . SetEnvironmentVariable ( CliFolderPathCalculator . DotnetHomeVariableName , sudoHome ) ;
38
38
39
- CopyUserNuGetConfigToOverriddenHome ( homeBeforeOverride ) ;
39
+ if ( homeBeforeOverride is not null )
40
+ {
41
+ CopyUserNuGetConfigToOverriddenHome ( homeBeforeOverride ) ;
42
+ }
40
43
}
41
44
}
42
45
43
46
/// <summary>
44
47
/// To make NuGet honor the user's NuGet config file.
45
- /// Copying instead of using the file directoy to avoid existing file being set higher permission
48
+ /// Copying instead of using the file directly to avoid existing file being set higher permission
46
49
/// Try to delete the existing NuGet config file in "/tmp/dotnet_sudo_home/"
47
50
/// to avoid different user's NuGet config getting mixed.
48
51
/// </summary>
You can’t perform that action at this time.
0 commit comments