bin: lil improvements

This commit is contained in:
xeruf 2023-04-10 18:31:48 +02:00
parent f8fa6fb67e
commit 9cd3d2df9d
4 changed files with 9 additions and 6 deletions

View File

@ -506,7 +506,7 @@ fi
lowercase() {
#$(which perl-rename || echo rename) -iv 'y/A-Z /a-z-/' "$@"
find "$@" -exec sh -c 'mv -iv {} "$(echo {} | tr "A-Z " "a-z-" | sed "s|---|_|;s|\.-|.|")" 2>/dev/null' \;
find "$@" -exec sh -c 'mv -iv "{}" "$(echo "{}" | tr "A-Z " "a-z-" | sed "s|---|_|;s|\.-|.|")" 2>/dev/null' \;
}
# TODO replace cp by rsync, automatically use compression for remote transfers

3
.local/bin/scripts/chexec Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh -ex
# Set exec flag on all files that should be executable
find -maxdepth 4 -name "*.sh" "$@" -exec chmod +x {} +

View File

@ -1,7 +1,4 @@
#!/bin/bash
git rev-parse @{upstream} >/dev/null 2>&1 ||
git branch --set-upstream-to=@{push}
git pull --rebase --autostash "$@" 2> >(head -4 >&2) ||
{ test -e $(git rev-parse --git-path rebase-merge) &&
printf "\e[31;1mError - aborting rebase!\e[0m\n" >&2 &&
git rebase --abort; }
git pull --rebase --autostash "$@" 2> >(head -4 >&2)

View File

@ -1,5 +1,8 @@
#!/bin/sh
git-l
git-l ||
{ test -e $(git rev-parse --git-path rebase-merge) &&
printf "\e[31;1mError - aborting rebase!\e[0m\n" >&2 &&
git rebase --abort; }
if git rev-parse @{upstream} >/dev/null 2>&1
then git push "$@"
else git push --set-upstream "$@"