summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgigamicro2024-04-15 15:11:40 -0400
committergigamicro2024-04-15 15:11:40 -0400
commit6c5abe888a0b79e6c4e9a9f8d96ba3bece7c4d45 (patch)
treeaa4670387247e37060fce4fc45bae010286766ee
parent1198ca8ce00def1a80efe81ea7df2416213e2814 (diff)
downloadaur-6c5abe888a0b79e6c4e9a9f8d96ba3bece7c4d45.tar.gz
add errors for missing EE.log location
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--wfinfo.sh20
3 files changed, 17 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7d4887fc7e66..0ca241b2a960 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -20,6 +20,6 @@ pkgbase = wfinfo-ng-git
source = wfinfo-ng::git+https://github.com/knoellle/wfinfo-ng.git
source = wfinfo.sh
sha256sums = SKIP
- sha256sums = eab3243b7e80db668f398ddd6483e2f2ed212773146a8344f250f5b5e4faea31
+ sha256sums = d26c9c91264551b3a1e3f644a80aa45fbf1af7af47fde8f179de4b0b4200bbe3
pkgname = wfinfo-ng-git
diff --git a/PKGBUILD b/PKGBUILD
index 302bd0498f75..cdcbc16fb74a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,7 +14,7 @@ optdepends=('mlocate: to autodetect EE.log location')
provides=('wfinfo')
#conflicts=('wfinfo')
source=("$_pkgname::git+https://github.com/knoellle/wfinfo-ng.git" 'wfinfo.sh')
-sha256sums=('SKIP' 'eab3243b7e80db668f398ddd6483e2f2ed212773146a8344f250f5b5e4faea31')
+sha256sums=('SKIP' 'd26c9c91264551b3a1e3f644a80aa45fbf1af7af47fde8f179de4b0b4200bbe3')
pkgver() {
cd "$srcdir/$_pkgname"
diff --git a/wfinfo.sh b/wfinfo.sh
index 6f0a63e5a282..5d1645f3938c 100644
--- a/wfinfo.sh
+++ b/wfinfo.sh
@@ -7,12 +7,10 @@ if [ -f "$CACHEDIR/filtered_items.json" ] && [ -f "$CACHEDIR/prices.json" ]; the
echo Update failed, continuing...
else
echo Update failed and no cached price info, exiting...
- exit 1
+ exit 2
fi
-# wfinfo-ng will create multiple PNG files in $PWD
-# this would delete them, but we've already got a cache directory anyway
-#cleanup(){ echo Exit; rm ./*.png; exit 130; }; trap cleanup INT
-exec wfinfo-ng "${1:-$(
+logloc="$1"; [ "$#" -ge 1 ] && shift
+logloc="${logloc:-$(
# EE.log location set manually in cachedir?
cat "$CACHEDIR/EElogloc" 2>&- ||
# find EE.log with most recent modification time
@@ -20,3 +18,15 @@ locate \*/Warframe/EE.log |
xargs -rd \\n stat -c '%Y %n' |
sort -n | tail -n 1 | cut -d ' ' -f 2-
)}"
+if ! [ "$logloc" ]; then
+ echo No EE.log location '($1)', exiting...
+ exit 3
+fi
+if ! [ -r "$logloc" ]; then
+ echo Invalid or unreadable EE.log location \""$one"\", exiting...
+ exit 4
+fi
+# wfinfo-ng will create multiple PNG files in $PWD
+# this would delete them, but we've already got a cache directory anyway
+#cleanup(){ echo Exit; rm ./*.png; exit 130; }; trap cleanup INT
+exec wfinfo-ng "$logloc" "$@"