blob: 2eb9f8fd334113d584cf66cc6397aae9cd70d1f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh
dldir="$HOME/Downloads"
if [ "$XDG_DOWNLOAD_DIR" ]; then
dldir="$XDG_DOWNLOAD_DIR"
elif (which xdg-user-dir >/dev/null 2>&1) && [ "$(xdg-user-dir DOWNLOAD)" ]; then
dldir="$(xdg-user-dir DOWNLOAD)"
fi
mkdir -p "$dldir"
cd "$dldir"
gitdir="$(basename -s .git "$1")"
test -e "$gitdir" && exit 1
git clone "$1" --depth=1 "$gitdir"
test "$EDITOR" || EDITOR="emacsclient"
emacsclient "$gitdir"
rm -rf "$gitdir"
|