mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-19 11:15:49 +00:00
Branch/fork-aware Edit on GitHub links (2/2)
(Thrice-amended commit with proper bash syntax)
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_fork: ripple
|
||||
github_forkurl: https://github.com/ripple/ripple-dev-portal/
|
||||
github_branch: master
|
||||
|
||||
- name: ripple.com
|
||||
display_name: Ripple Developer Center
|
||||
github_fork: ripple
|
||||
github_forkurl: https://github.com/ripple/ripple-dev-portal/
|
||||
github_branch: master
|
||||
template: template-contentwithtoc.html
|
||||
link_subs:
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#!/bin/bash
|
||||
mkdir -p out
|
||||
## One-liner syntax doesn't handle exit codes properly...
|
||||
#./build.sh -lq | awk '{print "rm -r out/ && ./build.sh -t "$1" && ./check-links.sh"}' | xargs -0 bash -c
|
||||
|
||||
# Pass forward extra dactyl args if provided
|
||||
if [ -n "$1" ];
|
||||
then
|
||||
dactyl_args=$1
|
||||
fi
|
||||
|
||||
targets=`dactyl_build -lq | awk '{print $1}'`
|
||||
linkerrors=0
|
||||
@@ -11,7 +15,7 @@ while read -r line; do
|
||||
echo "======================================="
|
||||
echo "Checking Target: $line"
|
||||
rm -r out
|
||||
dactyl_build -sq -t "$line"
|
||||
dactyl_build -sq -t "$line" "$dactyl_args"
|
||||
buildresult=$?
|
||||
if [ $buildresult -eq 0 ]
|
||||
then
|
||||
|
||||
@@ -7,7 +7,16 @@ echo "ghprbAuthorRepoGitUrl is: " ${ghprbAuthorRepoGitUrl}
|
||||
echo "ghprbSourceBranch is: " ${ghprbSourceBranch}
|
||||
echo "ghprbPullId is: " ${ghprbPullId}
|
||||
|
||||
gitForkWithoutSuffix=${ghprbAuthorRepoGitUrl%.git}
|
||||
|
||||
if [ -n "$ghprbPullId" ];
|
||||
then
|
||||
dactyl_vars='--vars '"'"'{"github_forkurl": "'"$gitForkWithoutSuffix"'", "github_branch": "'"$ghprbSourceBranch"'", "github_pr_id": "'"$ghprbPullId"'"}'"'"
|
||||
else
|
||||
dactyl_vars=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
tool/conflictmarkers.sh
|
||||
tool/all-target-link-checker.sh
|
||||
tool/all-target-link-checker.sh "$dactyl_vars"
|
||||
|
||||
@@ -55,15 +55,19 @@
|
||||
<div class="draft-warning">DRAFT PAGE</div>
|
||||
<div class="github-edit-wrap">
|
||||
{% if currentpage.md is defined %}
|
||||
{% set githuburl = "https://github.com/"
|
||||
+ target.github_fork + "/ripple-dev-portal/edit/"
|
||||
+ target.github_branch + "/content/" + currentpage.md %}
|
||||
{% set githuburl = target.github_forkurl + "/edit/"
|
||||
+ target.github_branch
|
||||
+ "/content/" + currentpage.md %}
|
||||
{% endif %}
|
||||
{% elif currentpage.template is defined %}
|
||||
{% set githuburl = "https://github.com/"
|
||||
+ target.github_fork + "/ripple-dev-portal/edit/"
|
||||
{% set githuburl = target.github_forkurl + "/edit/"
|
||||
+ target.github_branch + "/tool/" + currentpage.template %}
|
||||
{% else %}
|
||||
{% set githuburl = "https://github.com/ripple/ripple-dev-portal/" %}
|
||||
{% set githuburl = target.github_forkurl %}
|
||||
{% endif %}
|
||||
{% if target.is_pr_build %}
|
||||
{% set githuburl = githuburl + "?pr=/ripple/ripple-dev-portal/pull/"
|
||||
+ target.github_pr_id %}
|
||||
{% endif %}
|
||||
<a href="{{githuburl}}" class="github-edit">Edit on GitHub</a>
|
||||
</div><!-- /.github-edit -->
|
||||
|
||||
Reference in New Issue
Block a user