diff --git a/tasks/copy-assets-to-targets.sh b/tasks/copy-assets-to-targets.sh index 3cd99ee..8dfb98c 100755 --- a/tasks/copy-assets-to-targets.sh +++ b/tasks/copy-assets-to-targets.sh @@ -1,24 +1,32 @@ #!/bin/bash -e -if [ -d "$BTCPAY_TARGET" ]; then - cp dist/styles/btcpayserver-bootstrap.css "$BTCPAY_TARGET/BTCPayServer/wwwroot/main/bootstrap/bootstrap.css" - cp dist/scripts/bootstrap/* "$BTCPAY_TARGET/BTCPayServer/wwwroot/vendor/bootstrap/" - cp dist/svg/icons.svg "$BTCPAY_TARGET/BTCPayServer/wwwroot/img/icon-sprite.svg" - cp dist/svg/supporters.svg "$BTCPAY_TARGET/BTCPayServer/wwwroot/img/supporter-sprite.svg" +if [ -d "$BTCPAY_SERVER_WWWROOT" ]; then + cp dist/styles/btcpayserver-bootstrap.css "$BTCPAY_SERVER_WWWROOT/main/bootstrap/bootstrap.css" + cp dist/scripts/bootstrap/* "$BTCPAY_SERVER_WWWROOT/vendor/bootstrap/" + cp dist/svg/icons.svg "$BTCPAY_SERVER_WWWROOT/img/icon-sprite.svg" + cp dist/svg/supporters.svg "$BTCPAY_SERVER_WWWROOT/img/supporter-sprite.svg" # Update default.css rootSelector=":root {[\s\S]*?}\n" - defaultCSS="$BTCPAY_TARGET/BTCPayServer/wwwroot/main/themes/default.css" + defaultCSS="$BTCPAY_SERVER_WWWROOT/main/themes/default.css" defaultRoot=$(cat dist/styles/btcpayserver-variables.css | grep -oPz "$rootSelector") perl -0777 -i -pe "s/$rootSelector//" $defaultCSS echo -e "$defaultRoot\n$(cat $defaultCSS)" > $defaultCSS # Update default-dark.css rootDarkSelector=":root\[data-btcpay-theme='dark'\] {[\s\S]*?}\n" - defaultDarkCSS="$BTCPAY_TARGET/BTCPayServer/wwwroot/main/themes/default-dark.css" + defaultDarkCSS="$BTCPAY_SERVER_WWWROOT/main/themes/default-dark.css" defaultDarkRoot=$(cat dist/styles/btcpayserver-variables.css | grep -oPz "$rootDarkSelector" | sed "s/\[data-btcpay-theme='dark'\]//g") perl -0777 -i -pe "s/$rootSelector//" $defaultDarkCSS echo -e "$defaultDarkRoot$(cat $defaultDarkCSS)" > $defaultDarkCSS - echo "Copied assets to $BTCPAY_TARGET" + echo "Copied assets to $BTCPAY_SERVER_WWWROOT" +fi + +if [ -d "$BTCPAY_APP_WWWROOT" ]; then + cp dist/styles/btcpayserver-bootstrap.css "$BTCPAY_APP_WWWROOT/bootstrap/bootstrap.css" + cp dist/scripts/bootstrap/* "$BTCPAY_APP_WWWROOT/bootstrap/" + cp dist/svg/icons.svg "$BTCPAY_APP_WWWROOT/img/icon-sprite.svg" + + echo "Copied assets to $BTCPAY_APP_WWWROOT" fi