15 lines
561 B
Fish
15 lines
561 B
Fish
function hut_init --argument-names vis --argument-names repo --argument-names desc
|
|
if test "$(count $argv)" != 3
|
|
echo Require three args: visibility repo description
|
|
exit 1
|
|
end
|
|
if not test -d "$repo" && not test "$(path basename $(path resolve .))" = "$repo"
|
|
mkdir "$repo"
|
|
cd "$repo"
|
|
git init
|
|
else if not test -d "$repo" && test "$(path basename $(path resolve .))" = "$repo"
|
|
git init
|
|
end
|
|
set output "$(hut git create "$repo" -v "$vis" -d "$desc")"
|
|
git remote add origin "$output"
|
|
end
|