Skip to content

Instantly share code, notes, and snippets.

@drippdropp
Last active January 10, 2021 14:38
Show Gist options
  • Save drippdropp/44e33fcacc396dbe449fc1624e475e6b to your computer and use it in GitHub Desktop.
Save drippdropp/44e33fcacc396dbe449fc1624e475e6b to your computer and use it in GitHub Desktop.
Install all files from Brew fonts cask
# TODO: Add some basic validation around the absolute path required
# for `default_font_dir`. I just temp hardcoded the path before coz.. eh.
# Move the dir checking from the `producer` function as the pre-validation
# and path prep.
const default_font_dir = ARGS[1]
function producer(chnl::Channel)
for file in readdir(abspath(default_font_dir))
font_pkg_name = basename(file) |> splitext |> first
put!(chnl, font_pkg_name)
end
end
for pkg in Channel(producer)
try
# TODO: I'd like to limit this to the name of the package and the download indicator
# bar for each one. Most of the the other stdout is pretty boring.
resp = run(`brew install $pkg`)
print(resp)
println()
catch ex
# TODO: Put the pkg names (or maybe the shell command) into a file.
# On a side note: Need to install svn on `nyx`. Error was usually svn not being installed.
println("There was a failure with $pkg")
continue
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment