aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-12-13 11:16:29 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-12-13 11:16:29 +0100
commita524b71f558dcdd4f050f3e3f8a1ad2eac7443bd (patch)
tree6e8dab807ee65acbe6c507f086ecba2f5c2d00e1 /bin
parentef554a4c34fde7b66c13bc97f8168e432353ed7c (diff)
downloaddotfiles-a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd.tar.gz
dotfiles-a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd.tar.bz2
dotfiles-a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd.zip
Improving feedback on clone with project-open, Updated shiftwidth=2 widht setlocal instead of set to avoid poluting the other buffers, Updated newsboat video stream with mpv to enable going forward/backward
Diffstat (limited to 'bin')
-rwxr-xr-xbin/project-open24
1 files changed, 17 insertions, 7 deletions
diff --git a/bin/project-open b/bin/project-open
index 0dd5d31..955d31d 100755
--- a/bin/project-open
+++ b/bin/project-open
@@ -1,6 +1,7 @@
#!/bin/sh
# shellcheck disable=SC2088
+# (tile does not expand in single quote)
dest=$(
find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' |
sort -r |
@@ -15,7 +16,7 @@ dest_path="$HOME/git/$dest"
if cd "$dest_path" 2> /dev/null
then
touch "$dest_path"
- st
+ exec st
else
while [ -z "$choice" ]
do
@@ -27,16 +28,25 @@ else
mkdir -p "$dest_path"
cd "$dest_path" || exit 1
git init
+ exec st
;;
+
"clone")
- url="$(echo '' | dmenu -p "Entry repository url: ")"
- notify-send "Cloning $url to $dest_path"
- git clone --recursive "$url" "$dest_path" ||
- (notify-send -u critical "Clone failed"; exit 1)
- cd "$dest_path" || exit 1
+ while [ -z "$remote_choice" ]
+ do
+ remote_choice=$(printf 'github.com\ncacharle.xyz\nother' | dmenu -p "Remote location")
+ done
+ case "$remote_choice" in
+ "github.com") prefix='git@github.com:cacharle/' ;;
+ "cacharle.xyz") prefix='git@cacharle.xyz:/srv/git/' ;;
+ "other") ;;
+ esac
+ url="$prefix$(echo "$dest" | dmenu -p "Enter repository url: $prefix")"
+ st -e /bin/sh -c "git clone --recursive '$url' '$dest_path' && cd '$dest_path' && exec $SHELL" ||
+ notify-send -u critical "Could not clone $url in $dest_path" && exit 1
;;
+
"cancel") exit ;;
*) exit 1 ;;
esac
- st
fi