1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-05 11:06:00 +02:00

[chore] fix use of doublequotes and $(...) notation in deploy script (#3048)

This commit is contained in:
Max Strübing 2019-05-23 15:27:29 +02:00 committed by Waldir Pimenta
parent 7f317713a7
commit 11289f8a9b

View file

@ -5,7 +5,7 @@ set -ex
function initialize {
if [ -z "$TLDRHOME" ]; then
export TLDRHOME=${TRAVIS_BUILD_DIR:-`pwd`}
export TLDRHOME=${TRAVIS_BUILD_DIR:-$(pwd)}
fi
export TLDR_ARCHIVE="tldr.zip"
export SITE_HOME="$HOME/site"
@ -20,7 +20,7 @@ function initialize {
# Decrypt and add deploy key.
eval "$(ssh-agent -s)"
openssl aes-256-cbc -K $encrypted_973441be79af_key -iv $encrypted_973441be79af_iv -in ./scripts/id_ed25519_tldr_asset_upload.enc -out id_ed25519 -d
openssl aes-256-cbc -K "$encrypted_973441be79af_key" -iv "$encrypted_973441be79af_iv" -in ./scripts/id_ed25519_tldr_asset_upload.enc -out id_ed25519 -d
chmod 600 id_ed25519
ssh-add id_ed25519
}
@ -31,18 +31,18 @@ function rebuild_index {
}
function build_archive {
rm -f $TLDR_ARCHIVE
cd $TLDRHOME/
zip -r $TLDR_ARCHIVE pages*/ LICENSE.md index.json
rm -f "$TLDR_ARCHIVE"
cd "$TLDRHOME/"
zip -r "$TLDR_ARCHIVE" pages*/ LICENSE.md index.json
echo "Pages archive created."
}
function upload_assets {
git clone --quiet --depth 1 git@github.com:${SITE_REPO_SLUG}.git $SITE_HOME
mv -f $TLDR_ARCHIVE $SITE_HOME/assets/
cp -f $TLDRHOME/index.json $SITE_HOME/assets/
git clone --quiet --depth 1 git@github.com:${SITE_REPO_SLUG}.git "$SITE_HOME"
mv -f "$TLDR_ARCHIVE" "$SITE_HOME/assets/"
cp -f "$TLDRHOME/index.json" "$SITE_HOME/assets/"
cd $SITE_HOME
cd "$SITE_HOME"
git add -A
git commit -m "[TravisCI] uploaded assets after commits ${TRAVIS_COMMIT_RANGE}"
git push -q