initial files adapted from Vista
This commit is contained in:
24
scripts/sort-modlist
Normal file
24
scripts/sort-modlist
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
# Sorts the modlist.txt file in one of the module directories.
|
||||
# AGRB 11/5/2015
|
||||
|
||||
if [ "x$1" = "x" ]; then
|
||||
echo "Usage: $0 directory-name"
|
||||
exit 1
|
||||
fi
|
||||
dir=$1
|
||||
if [ ! -d $dir ]; then
|
||||
echo "$0: $dir is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f $dir/modlist.txt ]; then
|
||||
echo "$0: modlist.txt not found in $dir"
|
||||
exit 1
|
||||
fi
|
||||
[ -f $dir/modlist.txt.old ] && rm $dir/modlist.txt.old
|
||||
[ -f $dir/modlist.txt.new ] && rm $dir/modlist.txt.new
|
||||
sort $dir/modlist.txt > $dir/modlist.txt.new
|
||||
mv $dir/modlist.txt $dir/modlist.txt.old
|
||||
mv $dir/modlist.txt.new $dir/modlist.txt
|
||||
rm $dir/modlist.txt.old
|
||||
exit 0
|
||||
21
scripts/verify-mod-downloads
Normal file
21
scripts/verify-mod-downloads
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
# verify-mod-downloads - Checks a directory full of mod JAR files to make sure they've all been downloaded
|
||||
# and advises you on where to go to get them if they're not present.
|
||||
# AGRB 11/3/2015
|
||||
|
||||
die "Usage: $0 directory-name\n" if $#ARGV < 0;
|
||||
my $dir = $ARGV[0];
|
||||
die "$0: $dir is not a directory\n" unless -d $dir;
|
||||
die "$0: $dir does not contain a modlist.txt\n" unless -f "$dir/modlist.txt";
|
||||
open MODLIST, "<$dir/modlist.txt" or die "$0: unable to open $dir/modlist.txt";
|
||||
my $missing = 0;
|
||||
while (<MODLIST>) {
|
||||
chomp;
|
||||
($modjar, $url) = split(/\|/);
|
||||
unless (-f "$dir/$modjar") {
|
||||
print "$modjar is missing - download from $url\n";
|
||||
$missing++;
|
||||
}
|
||||
}
|
||||
close MODLIST;
|
||||
exit ($missing > 0) ? 1 : 0;
|
||||
Reference in New Issue
Block a user