mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-17 10:15:50 +00:00
Fix bugs in PR-aware "Edit in GitHub" code
works around BashFAQ #050 etc.
This commit is contained in:
@@ -42,12 +42,12 @@ targets:
|
||||
display_name: Ripple Developer Portal
|
||||
# These github_ fields are used by the template's "Edit on GitHub" link.
|
||||
# Override them with --vars to change which fork/branch to edit.
|
||||
github_forkurl: https://github.com/ripple/ripple-dev-portal/
|
||||
github_forkurl: https://github.com/ripple/ripple-dev-portal
|
||||
github_branch: master
|
||||
|
||||
- name: ripple.com
|
||||
display_name: Ripple Developer Center
|
||||
github_forkurl: https://github.com/ripple/ripple-dev-portal/
|
||||
github_forkurl: https://github.com/ripple/ripple-dev-portal
|
||||
github_branch: master
|
||||
template: template-contentwithtoc.html
|
||||
link_subs:
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
mkdir -p out
|
||||
|
||||
# Pass forward extra dactyl args if provided
|
||||
# Pass forward dactyl "vars" arg if provided
|
||||
if [ -n "$1" ];
|
||||
then
|
||||
dactyl_args=$1
|
||||
dactyl_vars=$1
|
||||
fi
|
||||
|
||||
targets=`dactyl_build -lq | awk '{print $1}'`
|
||||
@@ -15,7 +15,11 @@ while read -r line; do
|
||||
echo "======================================="
|
||||
echo "Checking Target: $line"
|
||||
rm -r out
|
||||
dactyl_build -sq -t "$line" "$dactyl_args"
|
||||
if [ -n "$dactyl_vars" ]; then
|
||||
dactyl_build -q -t "$line" --vars "$dactyl_vars"
|
||||
else
|
||||
dactyl_build -q -t "$line"
|
||||
fi
|
||||
buildresult=$?
|
||||
if [ $buildresult -eq 0 ]
|
||||
then
|
||||
|
||||
@@ -11,7 +11,7 @@ gitForkWithoutSuffix=${ghprbAuthorRepoGitUrl%.git}
|
||||
|
||||
if [ -n "$ghprbPullId" ];
|
||||
then
|
||||
dactyl_vars='--vars '"'"'{"github_forkurl": "'"$gitForkWithoutSuffix"'", "github_branch": "'"$ghprbSourceBranch"'", "github_pr_id": "'"$ghprbPullId"'"}'"'"
|
||||
dactyl_vars="'"'{"github_forkurl": "'"$gitForkWithoutSuffix"'", "github_branch": "'"$ghprbSourceBranch"'", "github_pr_id": "'"$ghprbPullId"'", "is_pr_build": true}'"'"
|
||||
else
|
||||
dactyl_vars=""
|
||||
fi
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
{% set githuburl = target.github_forkurl + "/edit/"
|
||||
+ target.github_branch
|
||||
+ "/content/" + currentpage.md %}
|
||||
{% endif %}
|
||||
{% elif currentpage.template is defined %}
|
||||
{% set githuburl = target.github_forkurl + "/edit/"
|
||||
+ target.github_branch + "/tool/" + currentpage.template %}
|
||||
|
||||
Reference in New Issue
Block a user