dotfiles/.config/shell/bin/gloned

16 lines
318 B
Text
Raw Normal View History

#!/bin/bash
# Git cLONE cD
# Can take extra arguments for git (ex: gloned url:/repo folder)
# shellcheck disable=SC2068,SC2016
git clone $@ || return $?
if ! cd "$(echo "$1" | sed 's/\.git//g' | rev | cut -d '/' -f 1 | rev)";then
echo 'Error: Could not `cd` into the repo'
return 1
fi
echo
# ls --color=auto