mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-23 07:04:11 -05:00
Improve the add-submodule script by making it so it doesn't need a second argument
This commit is contained in:
parent
b9a1f31aad
commit
76d82b14cf
1 changed files with 13 additions and 2 deletions
|
@ -1,6 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
[[ -z "$2" ]] && exit 1
|
||||
# Exit if no argument has been provided
|
||||
[[ -z "$1" ]] && exit 1
|
||||
|
||||
git submodule add "$1" "vim/bundle/$2"
|
||||
# Variables
|
||||
url="$1"
|
||||
name="${url/*\/}"
|
||||
|
||||
# Exit if no name exists or the url and name variables are the same
|
||||
[[ -z "$name" || "$url" = "$name" ]] && exit 1
|
||||
|
||||
# Add the submodule
|
||||
git submodule add "$url" "vim/bundle/$name" || exit 1
|
||||
|
||||
# Initialize the submodule
|
||||
git submodule update --init --recursive
|
||||
|
|
Loading…
Reference in a new issue