Skip to content

Instantly share code, notes, and snippets.

@schluppeck
Created March 22, 2022 22:34
Show Gist options
  • Save schluppeck/68bdd057ed980c4b288ce0cdf2f4a90a to your computer and use it in GitHub Desktop.
Save schluppeck/68bdd057ed980c4b288ce0cdf2f4a90a to your computer and use it in GitHub Desktop.
find julia packages in a list of Pluto notebooks or jl files

situation

need to quickly find out which packages a set of julia files are using. in my case, this was to create an environment after the fact... so I can ship it to people who have a clean install.

quick hack: grep through .jl files and find bits of text that start with "using"

not perfect, but got me 90% of the way there

grep "^\W*using" *.jl | cut -d: -f2 | sed s/using// | tr -d "[:blank:]" | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment