1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-06 17:06:05 +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 { function initialize {
if [ -z "$TLDRHOME" ]; then if [ -z "$TLDRHOME" ]; then
export TLDRHOME=${TRAVIS_BUILD_DIR:-`pwd`} export TLDRHOME=${TRAVIS_BUILD_DIR:-$(pwd)}
fi fi
export TLDR_ARCHIVE="tldr.zip" export TLDR_ARCHIVE="tldr.zip"
export SITE_HOME="$HOME/site" export SITE_HOME="$HOME/site"
@ -20,7 +20,7 @@ function initialize {
# Decrypt and add deploy key. # Decrypt and add deploy key.
eval "$(ssh-agent -s)" 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 chmod 600 id_ed25519
ssh-add id_ed25519 ssh-add id_ed25519
} }
@ -31,18 +31,18 @@ function rebuild_index {
} }
function build_archive { function build_archive {
rm -f $TLDR_ARCHIVE rm -f "$TLDR_ARCHIVE"
cd $TLDRHOME/ cd "$TLDRHOME/"
zip -r $TLDR_ARCHIVE pages*/ LICENSE.md index.json zip -r "$TLDR_ARCHIVE" pages*/ LICENSE.md index.json
echo "Pages archive created." echo "Pages archive created."
} }
function upload_assets { function upload_assets {
git clone --quiet --depth 1 git@github.com:${SITE_REPO_SLUG}.git $SITE_HOME git clone --quiet --depth 1 git@github.com:${SITE_REPO_SLUG}.git "$SITE_HOME"
mv -f $TLDR_ARCHIVE $SITE_HOME/assets/ mv -f "$TLDR_ARCHIVE" "$SITE_HOME/assets/"
cp -f $TLDRHOME/index.json $SITE_HOME/assets/ cp -f "$TLDRHOME/index.json" "$SITE_HOME/assets/"
cd $SITE_HOME cd "$SITE_HOME"
git add -A git add -A
git commit -m "[TravisCI] uploaded assets after commits ${TRAVIS_COMMIT_RANGE}" git commit -m "[TravisCI] uploaded assets after commits ${TRAVIS_COMMIT_RANGE}"
git push -q git push -q