Created
November 17, 2015 16:21
-
-
Save estliberitas/ac4c184ebc6a085cecb5 to your computer and use it in GitHub Desktop.
When you need versions of all the Bower dependencies
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
#!/bin/bash | |
# Hi guys! | |
# If it has happened with you and you got Bower dependencies | |
# and no `bower.json` file, and all you want is just have | |
# `bower.json` with those dependencies... | |
# You'll probably want to get those dependencies and their | |
# actual versions. And this is what simple command below does: | |
# Run it in a folder which keeps dependencies | |
# Optionally you can add `| tr '\n' ' '` - this way you'll get | |
# space-separated list which you can pass to `bower install --save` | |
grep -F -R -n '"version": ' ./*/bower.json | \ | |
tr '\t' ' ' | \ | |
sed -E 's/.\///;s/\/bower.json:[0-9]+:[ ]+"version": "/@/;s/",//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment