diff options
author | EuAndreh <eu@euandre.org> | 2018-12-29 16:31:39 -0200 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2018-12-29 16:31:39 -0200 |
commit | a54dc3b8c223de60732acdf3fad3b82ada9001ed (patch) | |
tree | b10aeb1950577d1513c7df55286f4a3da74e5839 /website | |
parent | Use Getopt::Long and Pod::Usage to build basic CLI. (diff) | |
download | euandre.org-a54dc3b8c223de60732acdf3fad3b82ada9001ed.tar.gz euandre.org-a54dc3b8c223de60732acdf3fad3b82ada9001ed.tar.xz |
Fix forwarding of arguments to sub-scripts.
Diffstat (limited to '')
-rwxr-xr-x | website | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 { |