mirror of https://github.com/aldy505/dotfiles.git
29 lines
550 B
Julia
Executable File
29 lines
550 B
Julia
Executable File
#!/usr/bin/env julia
|
|
|
|
using Downloads
|
|
|
|
if length(ARGS) == 0
|
|
println("please specify the gitignore template")
|
|
exit(0)
|
|
end
|
|
|
|
if isfile(".gitignore")
|
|
println("gitignore file already exists, delete that if you wanna make a new one")
|
|
exit(0)
|
|
end
|
|
|
|
template = ARGS[1]
|
|
|
|
r = Downloads.request(
|
|
"https://www.toptal.com/developers/gitignore/api/$template";
|
|
method = "GET", throw = false, output = ".gitignore",
|
|
)
|
|
|
|
if r.status != 200
|
|
println("the template specified does not exist")
|
|
exit(1)
|
|
end
|
|
|
|
println("gitignore successfully written")
|
|
exit(0)
|