COMMUNITY

[haxelibrarian] Bash script to list description of libs (does `haxelib info` of each `haxelib search` result)

Not a big contribution to science.
But in case it is useful to someone, here is a little bash script.
It simply does a haxelib info for each result of haxelib search WORD, and drops the list of releases.

For example:

localuser@localhost> haxelibrarian bootstrap
Name: priori-bootstrap
Tags: cross, html5, javascript, js, priori, spa, web, webapp
Desc: Bootstrap for Priori
Website: https://github.com/triture/priori-bootstrap
License: MIT
Owner: triture
Version: 0.1.1
----------------------------------------------------
Name: bootstrap
Tags: html, js
Desc: Twitter bootstrap with plugins.
Website: https://bitbucket.org/yar3333/haxe-bootstrap
License: LGPL
Owner: yar3333
Version: 1.0.6
----------------------------------------------------
Name: hxdom-bootstrap
Tags: cross, web
Desc: Provides type safe usage of Twitter Bootstrap components with hxdom.
Website: https://github.com/Blank101/haxe-dom-bootstrap
License: MIT
Owner: Blank101
Version: 1.0.1
----------------------------------------------------
Name: dtx-bootstrap
Tags: bootstrap, components, detox, dtx, interface, js, web, widgets
Desc: A set of detox widgets that let you easily work with Bootstrap and Bootstrap styled components.
Website: https://github.com/jasononeil/dtx-bootstrap
License: MIT
Owner: jason
Version: 0.0.0-alpha.6

Here’s the script if you’re interested:

#!/bin/bash
# Simply shows haxelib package description for each match of WORD

if [[ $# -lt 1 || $1 = -h || $1 = --help ]]; then
    echo "haxelibrarian makes an 'haxelib info' for each 'haxelib search WORD' result"
    echo "Missing search WORD"
    exit 1
fi

first=1
for lib in $( haxelib search "$1" | head -n -1 ); do
    [[ -z $first ]] && echo "----------------------------------------------------"
    haxelib info "$lib" | sed '/^Releases:/,$d'
    unset first
done
4 Likes