mirror of https://github.com/aldy505/dotfiles.git
30 lines
785 B
Julia
Executable File
30 lines
785 B
Julia
Executable File
#!/usr/bin/env julia
|
|
|
|
repo = ""
|
|
directory = ""
|
|
|
|
if length(ARGS) >= 1 && ARGS[1] != ""
|
|
if startswith(ARGS[1], "https://") || startswith(ARGS[1], "git@")
|
|
repo = ARGS[1]
|
|
elseif startswith(ARGS[1], "github:")
|
|
repo = "git@github.com:" * chop(ARGS[1], head = 7, tail = 0)
|
|
elseif startswith(ARGS[1], "gitlab:")
|
|
repo = "git@gitlab.com:" * chop(ARGS[1], head = 7, tail = 0)
|
|
elseif startswith(ARGS[1], "bitbucket:")
|
|
repo = "git@bitbucket.org:" * chop(ARGS[1], head = 10, tail = 0)
|
|
else
|
|
repo = "git@github.com:" * ARGS[1]
|
|
end
|
|
else
|
|
println("Repository can't be empty!!!")
|
|
exit(1)
|
|
end
|
|
|
|
if length(ARGS) > 1 && ARGS[2] != ""
|
|
directory = ARGS[2]
|
|
else
|
|
directory = split(repo, "/")[2]
|
|
end
|
|
|
|
run(`git clone --depth=1 $repo $directory`)
|
|
run(`rm -rf $directory/.git`) |