Skip to content

Commit ec092cd

Browse files
authored
Merge pull request #1885 from keymanapp/fix/cdnrefresh-path
fix: properly handle paths in init-container.sh
2 parents 5172586 + 1b273a4 commit ec092cd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

resources/init-container.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
#!/usr/bin/env bash
22

3+
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
4+
THIS_SCRIPT_PATH="$(dirname "$THIS_SCRIPT")"
5+
36
echo "--- Generating Keyboard Cache ---"
4-
rm -f keyboard/index.cache
5-
cd keyboard
7+
rm -f "$THIS_SCRIPT_PATH/../keyboard/index.cache"
8+
cd "$THIS_SCRIPT_PATH/../keyboard"
69
php -d include_path=/var/www/html/_includes:. _build_cache.php
710

811
if [[ ! $1 =~ "debug" ]]; then
912
echo "---- Generating CDN ---"
10-
cd ../cdn
13+
rm -rf "$THIS_SCRIPT_PATH/../cdn/deploy"
14+
cd "$THIS_SCRIPT_PATH/../cdn"
1115
php -d include_path=/var/www/html/_includes:. cdnrefresh.php
1216
cd ..
1317
else
1418
echo "Skip Generating CDN and clean CDN cache"
15-
rm -rf ../cdn/deploy
19+
rm -rf "$THIS_SCRIPT_PATH/../cdn/deploy"
1620
fi

0 commit comments

Comments
 (0)