DEV Community

Murahashi [Matt] Kenichi
Murahashi [Matt] Kenichi

Posted on

Show npm/yarn current package version in repository on GitHub organization

Show Ruby/Gem version in repository on GitHub organization - DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

yarn

$ for dir in */; do (cd $dir; git grep -n -A1 -E '^jquery@' yarn.lock 2>/dev/null|perl -ne 'print if s/  version "(.*?)"/$1/'| tr -s '\n' '\0' | xargs -0 -I {} printf "$(basename $(pwd))/{}\n") done
Enter fullscreen mode Exit fullscreen mode

npm

$ for dir in */; do (cd $dir; git grep -n -A1 -E '"jquery"' package-lock.json 2>/dev/null|perl -ne 'print if s/"version": "(.*?)"/$1/'| tr -s '\n' '\0' | xargs -0 -I {} printf "$(basename $(pwd))/{}\n") done
Enter fullscreen mode Exit fullscreen mode

Top comments (0)