Skip to content

Commit 30eaff2

Browse files
committed
Ignore cases when checking command line arguments.
Ignore cases when checking command line arguments such as -batchmode and -executemethod. Fixed googlesamples#364 Change-Id: I474ce7a5a272ae179073b8bd69d6a53950bb8d45
1 parent e2ea356 commit 30eaff2

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

source/IOSResolver/src/IOSResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ private static bool UnityCanLoadWorkspace {
943943
}
944944
// If Unity was launched from Unity Cloud Build the build pipeline does not
945945
// open the xcworkspace so we need to force project level integration of frameworks.
946-
if (System.Environment.CommandLine.Contains("-bvrbuildtarget")) {
946+
if (System.Environment.CommandLine.ToLower().Contains("-bvrbuildtarget")) {
947947
return false;
948948
}
949949
return (VersionHandler.GetUnityVersionMajorMinor() >= 5.6f - epsilon);

source/IntegrationTester/src/Runner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public static void DefaultTestCase(TestCase testCase,
248248
/// </summary>
249249
/// <param name="passed">Whether the tests passed.</param>
250250
private static void Exit(bool passed) {
251-
if (!Environment.CommandLine.Contains("-gvh_noexitontestcompletion")) {
251+
if (!Environment.CommandLine.ToLower().Contains("-gvh_noexitontestcompletion")) {
252252
UnityEditor.EditorApplication.Exit(passed ? 0 : 1);
253253
}
254254
}

source/VersionHandler/src/VersionHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private static bool BootStrapping {
112112
/// </summary>
113113
static VersionHandler() {
114114
// Schedule the process if the version handler isn't disabled on the command line.
115-
if (System.Environment.CommandLine.Contains("-gvh_disable")) {
115+
if (System.Environment.CommandLine.ToLower().Contains("-gvh_disable")) {
116116
UnityEngine.Debug.Log(String.Format("{0} bootstrap disabled",
117117
VERSION_HANDLER_ASSEMBLY_NAME));
118118
} else {

source/VersionHandlerImpl/src/ExecutionEnvironment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ internal class ExecutionEnvironment {
2929
/// Whether the editor was started in batch mode.
3030
/// </summary>
3131
public static bool InBatchMode {
32-
get { return Environment.CommandLine.Contains("-batchmode"); }
32+
get { return Environment.CommandLine.ToLower().Contains("-batchmode"); }
3333
}
3434

3535
/// <summary>
3636
/// Whether the editor was started with a method to executed.
3737
/// </summary>
3838
public static bool ExecuteMethodEnabled {
39-
get { return Environment.CommandLine.Contains("-executeMethod"); }
39+
get { return Environment.CommandLine.ToLower().Contains("-executemethod"); }
4040
}
4141

4242
/// <summary>
4343
/// Whether the UI should be treated as interactive.
4444
/// </summary>
4545
internal static bool InteractiveMode {
4646
get {
47-
return !(Environment.CommandLine.Contains("-gvh_noninteractive") ||
47+
return !(Environment.CommandLine.ToLower().Contains("-gvh_noninteractive") ||
4848
ExecutionEnvironment.InBatchMode);
4949
}
5050
}

source/VersionHandlerImpl/src/Logger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Logger {
4949
/// </summary>
5050
internal static bool DebugLoggingEnabled {
5151
get {
52-
return Environment.CommandLine.Contains("-gvh_log_debug");
52+
return Environment.CommandLine.ToLower().Contains("-gvh_log_debug");
5353
}
5454
}
5555

source/VersionHandlerImpl/src/VersionHandlerImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2476,7 +2476,7 @@ public static bool UseProjectSettings {
24762476
/// </summary>
24772477
public static bool Enabled {
24782478
get {
2479-
return !System.Environment.CommandLine.Contains("-gvh_disable") &&
2479+
return !System.Environment.CommandLine.ToLower().Contains("-gvh_disable") &&
24802480
settings.GetBool(PREFERENCE_ENABLED, defaultValue: true);
24812481
}
24822482
set { settings.SetBool(PREFERENCE_ENABLED, value); }

0 commit comments

Comments
 (0)