Fish shell로 간단하게 Boilerplate project clone 하는 Function

# clone githubId/repository
# clone githubId/repository directory
# clone githubId/repository directory branch
function clone
set length (count $argv)

if test $length -eq 3
set branch $argv[3]
else
set branch "master"
end

if test $length -eq 1
set script "console.log('$argv[1]'.split('/')[1])"
set github (node -e $script)
set directory $github[1]
else
set directory $argv[2]
end

set repository "https://github.com/$argv[1].git"

git clone --depth=1 --branch=$branch $repository $directory
cd $directory
rm -rf .git
end
clone iamssen/angular2-graphics-seed your-project
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.