Alter git remote url when rendering docs to fix github urls

This commit is contained in:
Starbeamrainbowlabs 2019-04-28 17:54:58 +01:00
parent bf75e22b06
commit 1cf10d8aa5
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 10 additions and 0 deletions

10
build
View File

@ -74,10 +74,20 @@ task_setup() {
task_docs() {
task_begin "Rendering API docs";
subtask_begin "Altering git remote";
remote_name="$(git remote | head -n1)";
remote_url="$(git remote get-url "${remote_name}")";
git remote set-url "${remote_name}" "https://github.com/sbrl/powahroot.git";
subtask_end $? "Failed to alter git remote";
subtask_begin "Calling 'documentation'";
node_modules/.bin/documentation build --github --output "${docs_output_folder}" --format html --favicon "logo.png" "$(jq --raw-output .main <package.json)";
subtask_end $? "'documentation' exited with an error";
subtask_begin "Reverting git remote alteration";
git remote set-url "${remote_name}" "${remote_url}";
subtask_end $? "Failed to revert remote alteration";
subtask_begin "Linking logo to docs folder";
cp -al "logo.png" "${docs_output_folder}/logo.png";
subtask_end $? "Failed to link logo";