mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-12-22 07:50:23 -05:00
Improve the add-submodule script by making it so it doesn't need a second argument
This commit is contained in:
parent
4f47e36040
commit
b063453342
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