commit 04304e8

hovercats  ·  2025-05-23 16:36:51 +0000 UTC
parent 1e003c6
do some better error handling when downloading
1 files changed,  +14, -1
M rcpm
M rcpm
+14, -1
 1@@ -17,7 +17,20 @@ fn rcpm_help {
 2 
 3 fn dl_pkg {
 4 	cd $RCPM_PATH/$pkg
 5-	test -f `{awk '{print $2}' sha256} || curl -LK url -O
 6+	if (test -f url) {
 7+		if (test -f sha256) {
 8+			if (test ! -f `{awk '{print $2}' sha256}) curl -LK url -O
 9+			if not printf 'File already downloaded.\n'
10+		}
11+		if not {
12+			printf 'sha256 file not found, downloading anyway...\n'
13+			curl -LK url -O
14+		}
15+	}
16+	if not {
17+		printf 'url file not found\n'
18+		exit 1
19+	}
20 }
21 
22 fn chksum_pkg {