-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plugin-info script for debugging, thanks @Jaynator495!
- Loading branch information
1 parent
0e40374
commit bcc1484
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# Adapted from a script provided by Jaynator495. | ||
# Make sure to place in home directory, chmod +x plugin-info.sh and then run with ./plugin-info.sh | ||
# Define the directory to scan | ||
directory_to_scan="~/homebrew/plugins" | ||
|
||
# Loop through each subdirectory (one level deep) | ||
for dir in "$directory_to_scan"/*/; do | ||
# Check if package.json exists in the subdirectory | ||
if [ -f "${dir}package.json" ]; then | ||
# Extract name and version from the package.json file using jq | ||
name=$(jq -r '.name' "${dir}package.json") | ||
version=$(jq -r '.version' "${dir}package.json") | ||
|
||
# Output the name and version | ||
echo "Directory: ${dir}" | ||
echo "Package Name: $name" | ||
echo "Version: $version" | ||
echo "-----------------------------" | ||
fi | ||
done |