|
|
@ -1,5 +1,9 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Copyright (c) 2020 The ZMK Contributors |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# SPDX-License-Identifier: MIT |
|
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
|
|
check_exists() { |
|
|
|
check_exists() { |
|
|
@ -148,9 +152,10 @@ git commit -m "Initial User Config." |
|
|
|
if [ -n "$github_repo" ]; then |
|
|
|
if [ -n "$github_repo" ]; then |
|
|
|
git remote add origin "$github_repo" |
|
|
|
git remote add origin "$github_repo" |
|
|
|
git push --set-upstream origin "$(git symbolic-ref --short HEAD)" |
|
|
|
git push --set-upstream origin "$(git symbolic-ref --short HEAD)" |
|
|
|
|
|
|
|
push_return_code=$? |
|
|
|
|
|
|
|
|
|
|
|
# If push failed, assume that the origin was incorrect and give instructions on fixing. |
|
|
|
# If push failed, assume that the origin was incorrect and give instructions on fixing. |
|
|
|
if [ $? -ne 0 ] { |
|
|
|
if [ ${push_return_code} -ne 0 ]; then |
|
|
|
echo "Remote repository $github_repo not found..." |
|
|
|
echo "Remote repository $github_repo not found..." |
|
|
|
echo "Check GitHub URL, and try adding again." |
|
|
|
echo "Check GitHub URL, and try adding again." |
|
|
|
echo "Run the following: " |
|
|
|
echo "Run the following: " |
|
|
@ -159,7 +164,7 @@ if [ -n "$github_repo" ]; then |
|
|
|
echo " git push --set-upstream origin $(git symbolic-ref --short HEAD)" |
|
|
|
echo " git push --set-upstream origin $(git symbolic-ref --short HEAD)" |
|
|
|
echo "Once pushed, your firmware should be availalbe from GitHub Actions at: ${github_repo%.git}/actions" |
|
|
|
echo "Once pushed, your firmware should be availalbe from GitHub Actions at: ${github_repo%.git}/actions" |
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
} |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# TODO: Support determing the actions URL when non-https:// repo URL is used. |
|
|
|
# TODO: Support determing the actions URL when non-https:// repo URL is used. |
|
|
|
if [ "${github_repo}" != "${github_repo#https://}" ]; then |
|
|
|
if [ "${github_repo}" != "${github_repo#https://}" ]; then |
|
|
|