Skip to content

Commit b7a2828

Browse files
committed
Download ebook into separete folder for tidiness
1 parent 7cb71ad commit b7a2828

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packt.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function log {
1010
}
1111

1212
function getBook {
13-
curl -s -L --retry $rtry -A "$agent" -b "$cookie" -c "$cookie" "https://www.packtpub.com/ebook_download/$book/$1" > "$dldir/$title.$1"
13+
mkdir -p "$dldir/$title"
14+
curl -s -L --retry $rtry -A "$agent" -b "$cookie" -c "$cookie" "https://www.packtpub.com/ebook_download/$book/$1" > "$dldir/$title/$title.$1"
1415
cex=$?; test "$cex" -ne "0" && { log "curl exit error code: $cex"; exit; }
1516
log "$1 downloaded"
1617
}

0 commit comments

Comments
 (0)