refactor web start scripts to be more portable
This commit is contained in:
@@ -1,9 +1,28 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
use App::Netdisco;
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
||||
BEGIN {
|
||||
# stuff useful locations into @INC and $PATH
|
||||
use Config;
|
||||
use FindBin;
|
||||
FindBin::again();
|
||||
use Path::Class 'dir';
|
||||
|
||||
my $location = $FindBin::RealBin;
|
||||
$ENV{PATH} = $location . $Config{path_sep} . $ENV{PATH};
|
||||
unshift @INC,
|
||||
dir($location)->parent->subdir('lib')->stringify,
|
||||
dir($location, 'lib')->stringify;
|
||||
}
|
||||
|
||||
use App::Netdisco;
|
||||
use Dancer;
|
||||
debug sprintf "App::Netdisco %s", ($App::Netdisco::VERSION || 'HEAD');
|
||||
|
||||
my $home = ($ENV{NETDISCO_HOME} || $ENV{HOME});
|
||||
set('session_dir', dir($home, 'netdisco-web-sessions'));
|
||||
|
||||
use App::Netdisco::Web;
|
||||
dance;
|
||||
|
||||
Reference in New Issue
Block a user