Skip to content

Commit

Permalink
Make the script fail on unsupported platforms.
Browse files Browse the repository at this point in the history
The old behavior was to fall back to linux related
routines. But since those will most certainly have
failed as well, this new behavior is probably better.
This change mostly concerns BSD or Solaris users, which
are not officially supported by the Shadowrun games anyway.
  • Loading branch information
Van-Ziegelstein committed Aug 26, 2018
1 parent 6d737c0 commit b8fb291
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions shadow_tune.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sub find_game_resources {

$op_params->{edition} =~ s/Hongkong/Hong\ Kong/;

PATH_TRIAL: foreach my $path_expr (@{$op_params->{install_dirs}{$op_params->{platform}}}) {
PATH_TRIAL: foreach my $path_expr (@{$op_params->{install_dirs}{$^O}}) {

foreach my $path (bsd_glob("$path_expr")) {

Expand Down Expand Up @@ -255,14 +255,14 @@ sub help_dialogue {

],

windows => [
MSWin32 => [

"c:/Program Files{, (x86)}/{,Steam/steamapps/common/}Shadowrun*",
"c:/GOG Games/Shadowrun*"

],

mac => [
darwin => [

"~/Library/Application Support/Steam/SteamApps/common/Shadowrun*"

Expand All @@ -288,12 +288,10 @@ sub help_dialogue {

#We try to determine the OS by checking what platform the Perl
#implementation was compiled for. Linux is the fallback value.
if ($^O eq 'MSWin32') { $op_params{platform} = "windows"; }

elsif ($^O eq 'darwin') { $op_params{platform} = "mac"; }

else { $op_params{platform} = "linux"; }

die "This platform seems to be unsupported.\n" unless
$^O eq 'MSWin32' ||
$^O eq 'darwin' ||
$^O eq 'linux';

until (@ARGV == 0) {

Expand All @@ -311,7 +309,7 @@ sub help_dialogue {
get_option();
chomp($ARGV[0]);
$ARGV[0] =~ s/\/$//;
unshift(@{$op_params{install_dirs}{$op_params{platform}}}, $ARGV[0]);
unshift(@{$op_params{install_dirs}{$^O}}, $ARGV[0]);
}

elsif ($ARGV[0] =~ /-e/i) { get_option(); chomp($op_params{edition} = "\L$ARGV[0]"); }
Expand Down

0 comments on commit b8fb291

Please sign in to comment.