Skip to content

Instantly share code, notes, and snippets.

@stevenocchipinti
Last active October 19, 2018 01:40
Show Gist options
  • Save stevenocchipinti/f4739689319e0443bceb66a55eb98887 to your computer and use it in GitHub Desktop.
Save stevenocchipinti/f4739689319e0443bceb66a55eb98887 to your computer and use it in GitHub Desktop.
An interactive version of `yarn run` for fish shell

yarnrun

An interactive version of yarn run for fish shell

Dependencies

Requires my pecorb gem (or an alternative)

gem install pecorb
function yarnrun --description 'An interactive version of `yarn run`'
set output (yarn run 2> /dev/null)
echo-bold "Commands available from bin scripts:"
echo $output[2] \
| cut -d: -f 2 \
| cut -c 2-
echo
echo-bold "Commands available from yarn scripts:"
echo $output \
| grep -o "\- [^ ]*" \
| cut -c 3- \
| pecorb \
| xargs yarn run
end
function echo-bold
echo (tput bold)$argv(tput sgr0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment