aboutsummaryrefslogtreecommitdiff
path: root/local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'local/bin')
-rwxr-xr-xlocal/bin/allsync60
-rwxr-xr-xlocal/bin/project-test30
2 files changed, 44 insertions, 46 deletions
diff --git a/local/bin/allsync b/local/bin/allsync
index 6e537e2..9539f0d 100755
--- a/local/bin/allsync
+++ b/local/bin/allsync
@@ -8,17 +8,17 @@ notify_bar() {
i3_astroid() {
pkill -0 astroid || return 0
- find "/run/user/$(id -u)/i3" "/tmp/i3-$(id -un)".* -name ipc-socket\* 2>/dev/null | \
+ find "/run/user/$(id -u)/i3" "/tmp/i3-$(id -un)".* -name ipc-socket\* 2>/dev/null |
while read -r socket; do
i3-msg -s "$socket" "exec astroid $*"
- done
+ done
}
cron_enable() {
pass mail/cynerd@email.cz >/dev/null # Cache keys
if command -v crontab >/dev/null; then
{
- crontab -l
+ crontab -l
echo "$cronline"
} | crontab -
else
@@ -46,33 +46,33 @@ cron_enabled() {
if [ "$#" -gt 0 ]; then
case "$1" in
- enable)
- cron_enable
- ;;
- disable)
+ enable)
+ cron_enable
+ ;;
+ disable)
+ cron_disable
+ ;;
+ enabled)
+ cron_enabled
+ ;;
+ state)
+ if cron_enabled; then
+ echo "Enabled"
+ else
+ echo "Disabled"
+ fi
+ ;;
+ toggle)
+ if cron_enabled; then
cron_disable
- ;;
- enabled)
- cron_enabled
- ;;
- state)
- if cron_enabled; then
- echo "Enabled"
- else
- echo "Disabled"
- fi
- ;;
- toggle)
- if cron_enabled; then
- cron_disable
- else
- cron_enable
- fi
- ;;
- *)
- echo "${0##*/}: Unknown argument: $1" >&2
- exit 1
- ;;
+ else
+ cron_enable
+ fi
+ ;;
+ *)
+ echo "${0##*/}: Unknown argument: $1" >&2
+ exit 1
+ ;;
esac
exit
fi
@@ -97,7 +97,6 @@ if [ "${ALLSYNC_FLOCK:-n}" != "y" ]; then
exit 1
fi
-
sec() {
echo -e '\e[1;34m==========' "$@" '==========\e[0m'
}
@@ -108,7 +107,6 @@ fail() {
ecode=1
}
-
sec "Passwords"
pass git pull || fail "Passwords pull failed"
pass git push || fail "Passwords push failed"
diff --git a/local/bin/project-test b/local/bin/project-test
index e8c6261..feab447 100755
--- a/local/bin/project-test
+++ b/local/bin/project-test
@@ -15,21 +15,21 @@ print_help() {
while [ -n "$1" ]; do
case $1 in
- -r|--ref)
- shift
- REF=$1
- ;;
- -c|--count)
- shift
- REF=HEAD~$1
- ;;
- --)
- shift
- break
- ;;
- *)
- break
- ;;
+ -r | --ref)
+ shift
+ REF=$1
+ ;;
+ -c | --count)
+ shift
+ REF=HEAD~$1
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ break
+ ;;
esac
shift
done