Skip to content

Commit

Permalink
Merge pull request #32 from CASEYGUNGEON/jukebox2
Browse files Browse the repository at this point in the history
system agnostic shelleo
  • Loading branch information
Tk420634 committed Jul 18, 2024
2 parents 389b7d2 + fe62047 commit d1a76c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/__HELPERS/shell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
var/err_file = ""
var/static/list/interpreters = list("[MS_WINDOWS]" = "cmd /c", "[UNIX]" = "sh -c")
var/interpreter = interpreters["[world.system_type]"]
var/static/list/arg_enclosers = list("[MS_WINDOWS]" = "\"", "[UNIX]" = "'")
var/closer = arg_enclosers["[world.system_type]"]
command = closer + command + closer
if(interpreter)
for(var/seo_id in shelleo_ids)
if(!shelleo_ids[seo_id])
Expand All @@ -25,7 +28,7 @@
shelleo_ids[shelleo_id] = TRUE
out_file = "[SHELLEO_NAME][shelleo_id][SHELLEO_OUT]"
err_file = "[SHELLEO_NAME][shelleo_id][SHELLEO_ERR]"
errorcode = shell("[interpreter] \"[command]\" > [out_file] 2> [err_file]")
errorcode = shell("[interpreter] [command] > [out_file] 2> [err_file]")
if(fexists(out_file))
stdout = file2text(out_file)
fdel(out_file)
Expand Down

0 comments on commit d1a76c2

Please sign in to comment.