aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2018-12-29 19:39:04 -0200
committerEuAndreh <eu@euandre.org>2018-12-29 19:39:04 -0200
commite2c68a6e801aedd77d06b8f12a358095c7d4292c (patch)
tree3bd9aa551aa1d038f6a4e837048e96bcfdacf9b0
parentRevert to file derived from template + envsubst. (diff)
downloadeuandre.org-e2c68a6e801aedd77d06b8f12a358095c7d4292c.tar.gz
euandre.org-e2c68a6e801aedd77d06b8f12a358095c7d4292c.tar.xz
Allow website subcommands to be run on any folder.
Diffstat (limited to '')
-rwxr-xr-xwebsite7
1 files changed, 5 insertions, 2 deletions
diff --git a/website b/website
index d85d72a..f6e060e 100755
--- a/website
+++ b/website
@@ -37,6 +37,7 @@ use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case bundling pass_through);
use Pod::Usage qw(pod2usage);
+use File::Basename qw(dirname);
my $help = 0;
my $title = '';
@@ -52,6 +53,8 @@ sub test {
sub escaped_cmd {
my ($cmd, @args) = @_;
+ my $dirname = dirname(__FILE__);
+ $cmd = "$dirname/$cmd";
$cmd = $cmd." \"$_\"", for @args;
system($cmd);
exit $? >> 8;
@@ -73,10 +76,10 @@ sub dispatch {
);
} elsif ($action eq 'pastebin') {
my @sub_args = grep { $_ ne $action } @args;
- escaped_cmd("./pastebin/website-pastebin", @sub_args);
+ escaped_cmd("pastebin/website-pastebin", @sub_args);
} elsif ($action eq 'slides') {
my @sub_args = grep { $_ ne $action } @args;
- escaped_cmd("./slides/website-slides", @sub_args);
+ escaped_cmd("slides/website-slides", @sub_args);
} elsif ($action eq 'test') {
test();
} else {