Skip to content

Commit 2c4128b

Browse files
committed
Command-line option to skip breakpoints. Useful for running/testing in a terminal.
1 parent 9eb6e47 commit 2c4128b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Assets/Scripts/Language/Runtime.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func Execute() -> void:
121121
ExecuteSnippet(SnippetGraphNode.MainSnippet.Data)
122122

123123

124-
func ExecuteSnippet(InSnippet: SnippetData, IsUnitTest := false) -> void:
124+
func ExecuteSnippet(InSnippet: SnippetData, IsUnitTest := false, SkipBreakpoints := false) -> void:
125125
if not IsEnabled():
126126
return
127127

@@ -145,7 +145,7 @@ func ExecuteSnippet(InSnippet: SnippetData, IsUnitTest := false) -> void:
145145
"Source": InSnippet.Source,
146146
"Name": InSnippet.Name,
147147
"Arguments": Args,
148-
"Breakpoints": InSnippet.Breakpoints
148+
"Breakpoints": InSnippet.Breakpoints if not SkipBreakpoints else []
149149
}
150150

151151
Latent = Thread.new()

Assets/Scripts/Startup.gd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func _ready() -> void:
4141
var Location = ""
4242
var SnippetName = ""
4343
var UseDebugger = false
44+
var SkipBreakpoints = false
4445
var Args: PoolStringArray = OS.get_cmdline_args()
4546
for Arg in Args:
4647
if Arg.begins_with("--snippet-run="):
@@ -51,17 +52,19 @@ func _ready() -> void:
5152
UseDebugger = true
5253
elif Arg == "--snippet-log":
5354
CreateLogFile()
55+
elif Arg == "--snippet-skipbp":
56+
SkipBreakpoints = true
5457

5558
if not Location.empty():
56-
var ExitCode: int = Run(Location, SnippetName, UseDebugger)
59+
var ExitCode: int = Run(Location, SnippetName, UseDebugger, SkipBreakpoints)
5760
get_tree().quit(ExitCode)
5861
else:
5962
# The main UI application starts here.
6063
var Instance = MainScene.instance()
6164
add_child(Instance)
6265

6366

64-
func Run(Location: String, SnippetName: String, UseDebugger := false) -> int:
67+
func Run(Location: String, SnippetName: String, UseDebugger := false, SkipBreakpoints := false) -> int:
6568
var _Error = Log.connect("OnLog", self, "OnLog")
6669

6770
if not Workspace.Open(Location):
@@ -88,7 +91,7 @@ func Run(Location: String, SnippetName: String, UseDebugger := false) -> int:
8891

8992
var Data: SnippetData = Workspace.GetSnippet(SnippetName)
9093
if Data:
91-
Runtime.ExecuteSnippet(Data, IsUnitTest)
94+
Runtime.ExecuteSnippet(Data, IsUnitTest, SkipBreakpoints)
9295

9396
while Runtime.IsRunning():
9497
Runtime._process(FrameTime)

0 commit comments

Comments
 (0)