forked from Fair-Strides/TSLPatcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTSLPatcherCLI.pl
30 lines (25 loc) · 1.16 KB
/
TSLPatcherCLI.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# TSLPatcherCLI as designed in Perl...
# Main script. Will use libraries TSLPatcher::FunctionsCLI.
###############################################################################
use lib 'lib/site'; # links the Bioware packages
use TSLPatcher::FunctionsCLI;
my $gamePath = $ARGV[0]; # swkotor directory
my $modPath = $ARGV[1]; # mod directory (folder where TSLPatcher lives)
my $installOption = $ARGV[2]; # Array index for mods with install options
# Change directory dividers to forward slash
$gamePath =~ s/\\/\//g;
$modPath =~ s/\\/\//g;
print "\n~~~ Game Path: $gamePath\n~~~ Mod Path: $modPath\n";
# Sets the base paths for the FunctionsCLI library
TSLPatcher::FunctionsCLI::Set_Base($modPath, $gamePath);
# With install options: Run ProcessNamespaces, SetInstallOption, RunInstallOption, Install
# Without install options: Run ProcessInstallPath, Install
if ($installOption eq "") {
TSLPatcher::FunctionsCLI::ProcessInstallPath;
TSLPatcher::FunctionsCLI::Install;
} else {
TSLPatcher::FunctionsCLI::ProcessNamespaces;
TSLPatcher::FunctionsCLI::SetInstallOption($installOption);
TSLPatcher::FunctionsCLI::RunInstallOption;
TSLPatcher::FunctionsCLI::Install;
}