Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit c1d3620

Browse files
committed
Only write vars.json if INSPECT_VARS is set
1 parent 5ce1cb3 commit c1d3620

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/ServiceStack.Text/Inspect.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ public static void DefaultVarsFilter(object anonArgs)
2020
try
2121
{
2222
var inspectVarsPath = Environment.GetEnvironmentVariable("INSPECT_VARS");
23-
if (inspectVarsPath == "0") // Disable
23+
if (string.IsNullOrEmpty(inspectVarsPath)) // Disable
2424
return;
2525

26-
var varsPath = inspectVarsPath?.Length > 0
27-
? Path.DirectorySeparatorChar == '\\'
28-
? inspectVarsPath.Replace('/','\\')
29-
: inspectVarsPath.Replace('\\','/')
30-
: VarsName;
26+
var varsPath = Path.DirectorySeparatorChar == '\\'
27+
? inspectVarsPath.Replace('/','\\')
28+
: inspectVarsPath.Replace('\\','/');
3129

3230
if (varsPath.IndexOf(Path.DirectorySeparatorChar) >= 0)
3331
Path.GetDirectoryName(varsPath).AssertDir();

0 commit comments

Comments
 (0)