Skip to content

Commit

Permalink
Format all shell scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
  • Loading branch information
khos2ow committed May 18, 2021
1 parent a5a438f commit 76b97b6
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 158 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: "./src"
scandir: "."

readme:
runs-on: ubuntu-latest
Expand Down
22 changes: 12 additions & 10 deletions scripts/pre-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
set -o errexit
set -o pipefail
set -o errtrace

NEW_VERSION=$1
PWD=$(cd "$(dirname "$0")" && pwd -P)

if [ -z "${NEW_VERSION}" ]; then
echo "Must have version like: v1.0.1"
exit 1
echo "Must have version like: v1.0.1"
exit 1
fi

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

if [[ "${CURRENT_BRANCH}" == "main" ]]; then
git pull origin main
git checkout -b "release/${NEW_VERSION}"
elif [[ "${CURRENT_BRANCH}" == "release/${NEW_VERSION}" ]]; then
git pull origin main
if [ "${CURRENT_BRANCH}" = "main" ]; then
git pull origin main
git checkout -b "release/${NEW_VERSION}"
elif [ "${CURRENT_BRANCH}" = "release/${NEW_VERSION}" ]; then
git pull origin main
else
echo "Invalid branch"
exit 1
echo "Invalid branch"
exit 1
fi

# Update README
Expand Down
12 changes: 7 additions & 5 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
set -o errexit
set -o pipefail
set -o errtrace

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

if [[ "${CURRENT_BRANCH}" != "main" ]]; then
echo "Must be on main branch"
exit 1
echo "Must be on main branch"
exit 1
fi

NEW_VERSION=$1

if [ -z "${NEW_VERSION}" ]; then
echo "Must have version like: v1.0.1"
exit 1
echo "Must have version like: v1.0.1"
exit 1
fi

git pull origin main
Expand Down
10 changes: 6 additions & 4 deletions scripts/update-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
set -o errexit
set -o pipefail
set -o errtrace

NEW_VERSION=$1

Expand All @@ -25,11 +27,11 @@ if [ -z "${NEW_VERSION}" ]; then
fi

if [ -z "${NEW_VERSION}" ]; then
echo "Must have version like: v1.0.1"
exit 1
echo "Must have version like: v1.0.1"
exit 1
fi

# Update the README
VERSION=${NEW_VERSION} gomplate -d action="${PWD}"/../action.yml -f "${PWD}"/../.github/templates/README.tpl -o "${PWD}"/../README.md

echo "README.md updated."
echo "README.md updated."
Loading

0 comments on commit 76b97b6

Please sign in to comment.