Dear Netlify Team, how could I specify the build command for branch context without file-base configuration?
I didn’t find an option to configure, I need to specify the
DEPLOY_PRIME_URL as the base URL for the branch preview, and the meanwhile use the
URL as base URL for production branch.
You cannot. Branch-specific commands can only be specified in
Thanks the quick response, I found a workaround.
HUGO_BASEURL=$([ "$BRANCH" = main ] && echo "$URL" || echo "$DEPLOY_PRIME_URL") && \
hugo --gc --minify -b $HUGO_BASEURL
Hi, @razonyang. I see you are using the
bash shell’s boolean logic in the build command to programmatically set
This is a great solution. Thank you for taking the time to share this method here. This is sure to be helpful for others and thanks again for sharing it.