You've already forked PlayIntegrityFork
mirror of
https://github.com/osm0sis/PlayIntegrityFork.git
synced 2025-09-06 06:37:06 +00:00
migrate.sh: clean up user argument parsing
This commit is contained in:
@@ -1,13 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
-h|--help|help) echo "sh migrate.sh [-f] [-o] [-a] [in-file] [out-file]"; exit 0;;
|
|
||||||
esac;
|
|
||||||
|
|
||||||
N="
|
N="
|
||||||
";
|
";
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
-h|--help|help) echo "sh migrate.sh [-f] [-o] [-a] [in-file] [out-file]"; exit 0;;
|
||||||
-i|--install|install) INSTALL=1; shift;;
|
-i|--install|install) INSTALL=1; shift;;
|
||||||
*) echo "custom.pif.json migration script \
|
*) echo "custom.pif.json migration script \
|
||||||
$N by osm0sis @ xda-developers $N";;
|
$N by osm0sis @ xda-developers $N";;
|
||||||
@@ -27,15 +24,14 @@ grep_check_json() {
|
|||||||
grep -q "$1" "$target" && [ "$(grep_get_json $1 "$target")" ];
|
grep -q "$1" "$target" && [ "$(grep_get_json $1 "$target")" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
until [ -z "$1" -o -f "$1" ]; do
|
||||||
-f|--force|force) FORCE=1; shift;;
|
case "$1" in
|
||||||
esac;
|
-f|--force|force) FORCE=1; shift;;
|
||||||
case "$1" in
|
-o|--override|override) OVERRIDE=1; shift;;
|
||||||
-o|--override|override) OVERRIDE=1; shift;;
|
-a|--advanced|advanced) ADVANCED=1; shift;;
|
||||||
esac;
|
*) die "Invalid argument/file not found: $1";;
|
||||||
case "$1" in
|
esac;
|
||||||
-a|--advanced|advanced) ADVANCED=1; shift;;
|
done;
|
||||||
esac;
|
|
||||||
|
|
||||||
if [ -f "$1" ]; then
|
if [ -f "$1" ]; then
|
||||||
FILE="$1";
|
FILE="$1";
|
||||||
|
|||||||
Reference in New Issue
Block a user