1
0
Fork 0

New git-get implementation

master
dump_stack() 2022-05-11 14:22:04 +00:00
parent 5a8766ddc5
commit ed082a4237
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 14 additions and 5 deletions

View File

@ -99,6 +99,20 @@ in {
initExtra = ''
which apt >/dev/null 2>&1 && plugins=("\$\{(@)plugins:#tmux-my\}")
# git does not support shell aliases as subcommands, but also
# there is no way to change the current working directory from
# the subprocess. Emulating the required behavior with the wrapper
function git {
if [[ "$1" = "get" ]]; then
REPO=$(echo $2 | sed 's;http.*://;;')
REPO=$(echo $REPO | sed 's;\.git$;;')
${pkgs.git}/bin/git clone https://$REPO $GOPATH/src/$REPO
cd $GOPATH/src/$REPO
else
${pkgs.git}/bin/git $@
fi
}
'';
};

View File

@ -130,11 +130,6 @@ in {
ghidra
(writeShellScriptBin "git-get" ''
REPO=$(echo $1 | sed 's;http.*://;;')
${git}/bin/git clone https://$REPO $GOPATH/src/$REPO
'')
(writeShellScriptBin "chromium" ''
${chromium}/bin/chromium --force-dark-mode \
--start-maximized \