Last active
November 6, 2019 08:42
-
-
Save eckelon/86b40f8105a692165a39e7cd36159da5 to your computer and use it in GitHub Desktop.
Small script for creating project configuration for @microsoft/rush. I use it with `jq`: `./generate-rush-project-config.sh | jq`
This file contains hidden or 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 | |
for i in $(ls -d */) | |
do | |
path="packages/${i/\//}" | |
name=$(cat "$i"/package.json | grep name | head -1 | sed 's/"//g' | sed 's/name: //g' | sed 's/,//g' | sed 's/ //g') | |
res="$res,{\"packageName\": \"$name\", \"projectFolder\": \"$path\"}" | |
done | |
echo "{\"projects\": [${res/,/}]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment