mom look, I made a degit clone using julia!

This commit is contained in:
Reinaldy Rafli 2021-09-14 21:49:51 +07:00
parent 89c546027b
commit f8218dc843
3 changed files with 33 additions and 1 deletions

30
bin/degit Executable file
View File

@ -0,0 +1,30 @@
#!/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`)

View File

@ -21,7 +21,7 @@ color-link identifier.macro ""
color-link identifier.class "#c792ea" # ok
color-link identifier.var "#c5e478" # ok
color-link indent-char "#515151"
color-link current-line-number "#4b6479,#000000" # ok
color-link current-line-number "#4b6479,#1d3b53" # ok
color-link line-number "#868686,#1B1B1B"
color-link preproc "#E0C589"
color-link preproc.shebang "#ef1f23" # ok

View File

@ -2,6 +2,8 @@
"*.go": {
"tabstospaces": false
},
"autosave": 60,
"clipboard": "terminal",
"colorscheme": "night-owl",
"tabsize": 2,
"tabtospaces": true