Fixed steamtricks install
This commit is contained in:
@@ -9,10 +9,10 @@ unsupported_shell () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install () {
|
install () {
|
||||||
export $SHELLPROFILE="$1"
|
export SHELLPROFILE="$1"
|
||||||
mkdir $HOME/.steamtricks
|
mkdir $HOME/.steamtricks
|
||||||
cp -r steamtricks/* $HOME/.steamtricks
|
cp -r steamtricks/* $HOME/.steamtricks
|
||||||
echo "export STEAMTRICKS_PREFIX=\"~/.steamtricks\"">>"${SHELLPROFILE}"
|
echo "export STEAMTRICKS_PREFIX=\"$HOME/.steamtricks\"">>"${SHELLPROFILE}"
|
||||||
echo "export PATH=\"\$PATH:$HOME/.steamtricks/bin\"">>"${SHELLPROFILE}"
|
echo "export PATH=\"\$PATH:$HOME/.steamtricks/bin\"">>"${SHELLPROFILE}"
|
||||||
|
|
||||||
echo "Install completed! Please source your profile $SHELLPROFILE to load the changes!"
|
echo "Install completed! Please source your profile $SHELLPROFILE to load the changes!"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env per
|
#!/usr/bin/env perl
|
||||||
l
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@@ -24,22 +23,27 @@ use constant {
|
|||||||
};
|
};
|
||||||
|
|
||||||
my $steamtricks_prefix = $ENV{'STEAMTRICKS_PREFIX'};
|
my $steamtricks_prefix = $ENV{'STEAMTRICKS_PREFIX'};
|
||||||
|
my $home = $ENV{'HOME'};
|
||||||
|
|
||||||
|
if ( ! $steamtricks_prefix ) {
|
||||||
|
die "Error! Please set your STEAMTRICKS_PREFIX environment variable.";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $home ) {
|
||||||
|
die "Error! HOME environment variable not set, don't know where to look!"
|
||||||
|
}
|
||||||
|
|
||||||
|
my $config_location = "${steamtricks_prefix}/steamtricks.conf";
|
||||||
my $change_install = '';
|
my $change_install = '';
|
||||||
my $create_install = '';
|
my $create_install = '';
|
||||||
my $new_config = '';
|
my $new_config = '';
|
||||||
my $game = '';
|
my $game = '';
|
||||||
my $game_version = '';
|
my $game_version = '';
|
||||||
my $home = $ENV{'HOME'};
|
|
||||||
my $new_steam_prefix = "${home}/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common";
|
my $new_steam_prefix = "${home}/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common";
|
||||||
my $help = '';
|
my $help = '';
|
||||||
my $version = '';
|
my $version = '';
|
||||||
my $print_version = '';
|
my $print_version = '';
|
||||||
|
|
||||||
if ( ! $steamtricks_prefix ) {
|
|
||||||
die "Please set your STEAMTRICKS_PREFIX environment variable";
|
|
||||||
}
|
|
||||||
my $config_location = "${steamtricks_prefix}/steamtricks.conf";
|
|
||||||
|
|
||||||
GetOptions (
|
GetOptions (
|
||||||
'create-managed-install' => \$create_install,
|
'create-managed-install' => \$create_install,
|
||||||
'change-managed-install' => \$change_install,
|
'change-managed-install' => \$change_install,
|
||||||
@@ -101,7 +105,7 @@ sub setup_config {
|
|||||||
if ( $ans =~ /^[yY].?$/ ) {
|
if ( $ans =~ /^[yY].?$/ ) {
|
||||||
$Config = create_config;
|
$Config = create_config;
|
||||||
} else {
|
} else {
|
||||||
die "Config not created";
|
die "Error! Config not created.";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -115,7 +119,7 @@ sub create_config {
|
|||||||
general => { "steam_prefix" => $new_steam_prefix },
|
general => { "steam_prefix" => $new_steam_prefix },
|
||||||
install_manager => { "managed_games[]" => ""}
|
install_manager => { "managed_games[]" => ""}
|
||||||
});
|
});
|
||||||
$Config->write( ${config_location} ) or die "Config file $config_location could not be written: $!";
|
$Config->write( ${config_location} ) or die "Error! Config file $config_location could not be written: $!";
|
||||||
return $Config;
|
return $Config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +131,7 @@ sub update_config {
|
|||||||
} else {
|
} else {
|
||||||
$Config->{_}->{$key} = $value;
|
$Config->{_}->{$key} = $value;
|
||||||
}
|
}
|
||||||
$Config->write($config_location) or die "Config file $config_location could not be written: $!";
|
$Config->write($config_location) or die "Error! Config file $config_location could not be written: $!";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub create_install {
|
sub create_install {
|
||||||
@@ -147,13 +151,13 @@ sub create_install {
|
|||||||
my $ans = <STDIN>;
|
my $ans = <STDIN>;
|
||||||
chomp $ans;
|
chomp $ans;
|
||||||
if ($ans =~ /^[nN].?$/ ) {
|
if ($ans =~ /^[nN].?$/ ) {
|
||||||
die "Config not upddated, exiting";
|
die "Config not upddated.";
|
||||||
} else {
|
} else {
|
||||||
update_config("install_manager", "managed_games[]", $game);
|
update_config("install_manager", "managed_games[]", $game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
die "Game not found at ${steam_prefix}/${game} please check your steam_prefix and your game name";
|
die "Error! Game not found at ${steam_prefix}/${game} please check your steam_prefix and your game name.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +178,7 @@ sub change_install {
|
|||||||
or die "Could not create symlink ${steam_prefix}/${game}: $!";
|
or die "Could not create symlink ${steam_prefix}/${game}: $!";
|
||||||
print "You may now change any beta settings and restart Steam to apply your changes\n";
|
print "You may now change any beta settings and restart Steam to apply your changes\n";
|
||||||
} else {
|
} else {
|
||||||
die "${steam_prefix}/${game} is not a symlink, please run with --create-managed-install";
|
die "Error! ${steam_prefix}/${game} is not a symlink, please run with --create-managed-install";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
0
webinstall.sh
Normal file → Executable file
0
webinstall.sh
Normal file → Executable file
Reference in New Issue
Block a user