Last active
November 24, 2022 12:16
-
-
Save jordanrobinson/19de4975c4f3a75fdfa3f99956ab6062 to your computer and use it in GitHub Desktop.
code audit bash script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
printf "\n --- $2\n" | |
git clone "$1" $2 && | |
printf "\nCommits on Master: $(cd $2 && git rev-list --count master 2>&1 && cd ..)" && | |
printf "\nFirst commit: $(cd $2 && git log --pretty=format:"%h %an %cD %s" --reverse | head -n1 2>&1 && cd ..)\n" && | |
printf "\nLines of code:\n\n" && | |
cloc $2 && | |
printf "\nDependencies:\n\n" && | |
printf "Clojure: \n$(cd $2 && lein licenses || echo "N/A" 2>&1 && cd ..)\n\n" || true && | |
printf "Javascript: \n$(cd $2 && npm i --silent --no-progress && npx license-report --only=prod --output=csv --fields=name --fields=installedVersion --fields=licenseType || echo "N/A" 2>&1 && cd ..)\n\n" || true && | |
printf "PHP: \n$(cd $2 && composer install -n || true && composer licenses -n --no-plugins --no-dev || echo "N/A" 2>&1 && cd ..)\n\n" || true && | |
rm -rf $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run it like
./audit.sh git@github.com:org/foo bar
where bar is the directory name and title of the output