From a54dc3b8c223de60732acdf3fad3b82ada9001ed Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 29 Dec 2018 16:31:39 -0200 Subject: Fix forwarding of arguments to sub-scripts. --- website | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/website b/website index 89d47b7..370b38c 100755 --- a/website +++ b/website @@ -50,6 +50,13 @@ sub test { die "FIXME"; } +sub escaped_cmd { + my ($cmd, @args) = @_; + $cmd = $cmd." \"$_\"", for @args; + system($cmd); + exit $? >> 8; +} + sub dispatch { my $action = shift; my @args = @_; @@ -66,11 +73,9 @@ sub dispatch { -exitval => 2 ); } elsif ($action eq 'pastebin') { - print `./pastebin/website-pastebin @sub_args`; - exit $? >> 8; + escaped_cmd("./pastebin/website-pastebin", @sub_args); } elsif ($action eq 'slides') { - print `./pastebin/website-slides @sub_args`; - exit $? >> 8; + escaped_cmd("./slides/website-slides", @sub_args); } elsif ($action eq 'test') { test(); } else { -- cgit v1.2.3