refactoring
This commit is contained in:
@@ -19,6 +19,7 @@ set -e
|
||||
# -rwxr-xr-x 0 ed ed 183808 Nov 19 00:43 copyparty-extras/sfx-lite/copyparty-sfx.py
|
||||
|
||||
|
||||
command -v gtar && tar=gtar || tar=tar
|
||||
td="$(mktemp -d)"
|
||||
od="$(pwd)"
|
||||
cd "$td"
|
||||
@@ -28,7 +29,7 @@ pwd
|
||||
# debug: if cache exists, use that instead of bothering github
|
||||
cache="$od/.copyparty-repack.cache"
|
||||
[ -e "$cache" ] &&
|
||||
tar -xvf "$cache" ||
|
||||
$tar -xvf "$cache" ||
|
||||
{
|
||||
# get download links from github
|
||||
curl https://api.github.com/repos/9001/copyparty/releases/latest |
|
||||
@@ -43,7 +44,7 @@ cache="$od/.copyparty-repack.cache"
|
||||
tr -d '\r' | tr '\n' '\0' | xargs -0 curl -L --remote-name-all
|
||||
|
||||
# debug: create cache
|
||||
#tar -czvf "$cache" *
|
||||
#$tar -czvf "$cache" *
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +57,7 @@ mv copyparty-*.tar.gz copyparty-extras/
|
||||
|
||||
# unpack the source code
|
||||
( cd copyparty-extras/
|
||||
tar -xvf *.tar.gz
|
||||
$tar -xvf *.tar.gz
|
||||
)
|
||||
|
||||
|
||||
@@ -92,7 +93,7 @@ cp -pv "$od/$0" copyparty-extras/
|
||||
|
||||
# create the bundle
|
||||
fn=copyparty-$(date +%Y-%m%d-%H%M%S).tgz
|
||||
tar -czvf "$od/$fn" *
|
||||
$tar -czvf "$od/$fn" *
|
||||
cd "$od"
|
||||
rm -rf "$td"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user