Skip to content

Commit

Permalink
feat: smaller descriptions and aliging them
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushSehrawat committed May 25, 2023
1 parent a1062e8 commit 6e229be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 9 additions & 3 deletions brain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,16 @@ if [[ $1 =~ (neurons) ]]; then
fi
case "$3" in
"remote")
echo "Available packages:\n"
echo "<package-name> : <package-description>"
echo -e "Available packages:\n"
printf "%-30s %s\n" "Name" "Description"
NEURONS=$(curl -s https://api.github.com/repos/neobrains/brain/contents/neurons | jq -r '.[].name')

NEURONS_DESCRIPTION=$(curl -s https://raw.githubusercontent.com/neobrains/brain/main/descriptions.json)

for package in $NEURONS; do
package_name=$(echo "$package" | sed 's/\.sh$//')
description=$(echo $NEURONS_DESCRIPTION | jq -r ".$package_name")
printf "%-30s %s\n" "$package_name" "$description"
done
;;
"local")
echo "not implemented yet"
Expand Down
10 changes: 5 additions & 5 deletions descriptions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"discord" : "Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.",
"edge" : "Microsoft Edge is a fast, secure, and productive browser that helps you save money, earn points, and access exclusive deals.",
"rust" : "Rust is a multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency.",
"golang" : "Go is a statically typed, compiled high-level programming language",
"vscode" : "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications."
"discord" : "Messaging, Voice, and Video Client",
"edge" : "Fast, secure, and productive browser that helps you save money, earn points, and access exclusive deals.",
"rust" : "Multi-paradigm, general-purpose programming language that emphasizes performance, type safety, and concurrency.",
"golang" : "Statically typed, compiled high-level programming language",
"vscode" : "Visual Studio Code. Code editing. Redefined."
}

0 comments on commit 6e229be

Please sign in to comment.