Pretty shell format.

This commit is contained in:
Cotes Chung
2020-09-01 14:54:29 +08:00
parent 252e33b502
commit c473771af4
7 changed files with 50 additions and 88 deletions

View File

@@ -15,7 +15,6 @@ LASTMOD=false
WORK_DIR="$(dirname "$(dirname "$(realpath "$0")")")"
check_status() {
local _change=$(git status . -s)
@@ -26,13 +25,11 @@ check_status() {
fi
}
update_files() {
bash _scripts/sh/create_pages.sh
bash _scripts/sh/dump_lastmod.sh
}
commit() {
msg="Updated"
@@ -44,7 +41,7 @@ commit() {
if [[ ! -z $(git status tags -s) ]]; then
git add tags/
if [[ $CATEGORIES = true ]]; then
if $CATEGORIES; then
msg+=","
else
msg+=" the"
@@ -53,9 +50,9 @@ commit() {
TAGS=true
fi
if [[ ! -z $(git status _data -s) ]]; then
if [[ -n $(git status _data -s) ]]; then
git add _data
if [[ $CATEGORIES = true || $TAGS = true ]]; then
if $CATEGORIES || $TAGS; then
msg+=","
else
msg+=" the"
@@ -64,7 +61,7 @@ commit() {
LASTMOD=true
fi
if [[ $CATEGORIES = true || $TAGS = true || $LASTMOD = true ]]; then
if $CATEGORIES || $TAGS || $LASTMOD; then
msg+=" for post(s)."
git commit -m "[Automation] $msg" -q
else
@@ -73,13 +70,11 @@ commit() {
}
push() {
git push origin master -q
echo "[INFO] Published successfully!"
}
main() {
cd "$WORK_DIR"
@@ -93,5 +88,4 @@ main() {
push
}
main