Skip to content

Code broken when debug enable #212

@Beanux

Description

@Beanux

An issue only happening by using the debug mode.

Because function return text and that text is used for the code for next step,
debug mode break it and add the debug content to the return of the function.

I'm suggestion debug to use error output rather than normal output (normal is catched by your code).

Here is the change:

diff --git a/factorio b/factorio
index 3fb7ad3..b9389d1 100755
--- a/factorio
+++ b/factorio
@@ -12,7 +12,7 @@
 
 function debug() {
   if [ "${DEBUG-0}" -gt 0 ]; then
-    echo "DEBUG: $*"
+    echo "DEBUG: $*" 1>&2
   fi
 }

Original one
original_debug

Patched one
patched_debug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions