aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2018-12-29 16:31:39 -0200
committerEuAndreh <eu@euandre.org>2018-12-29 16:31:39 -0200
commita54dc3b8c223de60732acdf3fad3b82ada9001ed (patch)
treeb10aeb1950577d1513c7df55286f4a3da74e5839
parentUse Getopt::Long and Pod::Usage to build basic CLI. (diff)
downloadeuandre.org-a54dc3b8c223de60732acdf3fad3b82ada9001ed.tar.gz
euandre.org-a54dc3b8c223de60732acdf3fad3b82ada9001ed.tar.xz
Fix forwarding of arguments to sub-scripts.
-rwxr-xr-xwebsite13
1 files 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 {