2021-09-11 09:35:48 +00:00
|
|
|
#!/usr/bin/env julia
|
|
|
|
|
2021-09-15 05:30:02 +00:00
|
|
|
using Downloads
|
2021-09-11 09:35:48 +00:00
|
|
|
|
|
|
|
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]
|
|
|
|
|
2021-09-15 05:30:02 +00:00
|
|
|
r = Downloads.request(
|
|
|
|
"https://www.toptal.com/developers/gitignore/api/$template";
|
|
|
|
method = "GET", throw = false, output = ".gitignore",
|
|
|
|
)
|
2021-09-11 09:35:48 +00:00
|
|
|
|
|
|
|
if r.status != 200
|
|
|
|
println("the template specified does not exist")
|
|
|
|
exit(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
println("gitignore successfully written")
|
|
|
|
exit(0)
|