-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate licenses we fail to detect on pub.dev #1015
Labels
type-enhancement
A request for a change that isn't a bug
Comments
To download all raw license files from pub.dev, one can use a script like: # Get all package names
get_all_package_names() { curl -s https://pub.dev/api/package-names | jq -r .packages[]; }
# Given a package name, get archive URL for latest version
get_archive_url() { curl -sL "https://pub.dev/api/packages/$1" | jq -r .latest.archive_url; }
# Given a package name, get LICENSE file from latest version
get_license() { curl -sL $(get_archive_url "$1") | tar -xzO --ignore-case LICENSE 2> /dev/null; }
# Given a package name, download license to LICENSE-<package>.txt
download_license() { get_license "$1" > "LICENSE-$1.txt"; }
export -f get_all_package_names
export -f get_archive_url
export -f get_license
export -f download_license
get_all_package_names | parallel -j 100 download_license This is a bit traffic heavy, don't run it frequently 🤣 EDIT: Fixed |
Nit: I think the script as presented gets README.md files, not LICENSE files.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result from running analysis on pub.dev
Code for running this analysis:
This should be easy to tweak to get names of the packages..
The text was updated successfully, but these errors were encountered: