This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8700c7c
commit c4385b0
Showing
2 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,44 @@ | ||
#!/bin/bash | ||
# v20230630.1 | ||
|
||
# TODO read component names into array | ||
# TODO read replacement configuration into array | ||
REQUIRED_TOOLS=( | ||
git | ||
hugo | ||
typos | ||
) | ||
|
||
for TOOL in "${REQUIRED_TOOLS[@]}"; do | ||
if ! command -v "${TOOL}" >/dev/null; then | ||
echo "${TOOL} is required... " | ||
exit 1 | ||
fi | ||
done | ||
|
||
FILE=.env | ||
if [ -f "$FILE" ]; then | ||
echo "exporting .env" | ||
set -a # export all variables created next | ||
# this routine ranges through a folder of files that we don't explicitly know (@davidsneighbour) | ||
# see https://github.com/koalaman/shellcheck/wiki/SC1090 | ||
# shellcheck source=/dev/null | ||
source "${FILE}" | ||
set +a # stop exporting | ||
else | ||
echo "no .env file found" | ||
exit 0 | ||
fi | ||
|
||
SCRIPTPATH="$( | ||
cd "$(dirname "$0")" >/dev/null 2>&1 || exit | ||
pwd -P | ||
)" | ||
CURPATH="$(pwd -P)" | ||
|
||
hugo mod get -u ./... | ||
hugo mod tidy | ||
|
||
git add "${CURPATH}"/go.mod | ||
FILE="${CURPATH}"/go.sum | ||
if test -f "$FILE"; then | ||
git add go.sum | ||
fi |