Use correct syntax for tar to drop directory structure

This commit is contained in:
William Wernert
2021-06-01 12:06:02 -04:00
parent eac5c604bd
commit 91c8a7c65b
2 changed files with 2 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ generate_and_clean_tarballs() {
local new_version local new_version
new_version=$(cat $UPDATE_DIR/VERSION) new_version=$(cat $UPDATE_DIR/VERSION)
[ -d /opt/so/repo ] || mkdir -p /opt/so/repo [ -d /opt/so/repo ] || mkdir -p /opt/so/repo
tar -czf "/opt/so/repo/$new_version.tar.gz" "$UPDATE_DIR" tar -czf "/opt/so/repo/$new_version.tar.gz" -C "$UPDATE_DIR" .
find "/opt/so/repo" -type f -not -name "$new_version.tar.gz" -exec rm -rf {} \; find "/opt/so/repo" -type f -not -name "$new_version.tar.gz" -exec rm -rf {} \;
} }

View File

@@ -1425,7 +1425,7 @@ generate_passwords(){
generate_repo_tarball() { generate_repo_tarball() {
mkdir /opt/so/repo mkdir /opt/so/repo
tar -czf /opt/so/repo/"$SOVERSION".tar.gz ../. tar -czf /opt/so/repo/"$SOVERSION".tar.gz -C "$(pwd)/.." .
} }
generate_sensor_vars() { generate_sensor_vars() {