Commits

Jack Frost committed 8092a92

removal of debug info, sum fixes

Comments (0)

Files changed (2)

 			return 1
 		}
 	}
+
+	[[ -e "$minecraft_dir" ]] && {
+		[[ -h "$minecraft_dir" ]] && {
+			rm "$minecraft_dir"
+		} || {
+			digger.err "$minecraft_dir exists and is not a symlink!"
+			return 1
+		}
+	}
+
+	return 0
 }
 
 digger.err() { echo "[digger] (error) $1" >&2; }
 		return 1
 	}
 
-	echo "$enderman_path, $digger_dir/$minecraft_instance"
-	echo "bash \"$enderman_path\" -d \"$digger_dir/$minecraft_instance\" \"$1\""
-
 	bash "$enderman_path" -d "$digger_dir/$minecraft_instance" "$1"
 }
 
 digger.exclude() {
 	[[ "$2" ]] && { echo "$1"; return 1; }
+	return 0
 }
 
 # Main part
 	digger.patch || { exit 25; }
 }
 
-[[ -e "$minecraft_dir" ]] && {
-	[[ -h "$HOME/.minecraft" ]] && {
-		rm "$minecraft_dir"
-	} || {
-		digger.err "$minecraft_dir exists and is not a symlink!"
-		exit 9
-	}
-}
 
 [[ -e "$digger_dir/$minecraft_instance" ]] && {
 	ln -s "$digger_dir/$minecraft_instance" "$minecraft_dir"
 }
 
 enderman.get_pkg() {
+	enderman.msg "Downloading $cfg_zip_url..."
 	curl -fkL "$cfg_zip_url" > "$cfg_tmp_dir/enderman.zip"
 }
 
+enderman.unpack_pkg() {
+	enderman.msg "Unpacking enderman.zip..."
+	unzip "$cfg_tmp_dir/enderman.zip" -d "$cfg_tmp_dir" >/dev/null
+}
+
 enderman.cleanup() { rm -r "$cfg_tmp_dir"; }
-# trap 'enderman.cleanup' EXIT
+trap 'enderman.cleanup' EXIT
 
 while getopts 'hd:' opt; do
 	case "$opt" in
 	}
 }
 
-enderman.catch unzip_pkg "unzip $cfg_tmp_dir/enderman.zip -d $cfg_tmp_dir" && {
+enderman.catch unpack_pkg enderman.unpack_pkg && {
 	rm "$cfg_tmp_dir/enderman.zip"
 } || {
 	enderman.err "Could not unzip pack, exiting"