Created
August 16, 2021 17:51
-
-
Save douglampe/7251e2d8a6e91301e7605fd9a85cf2cc to your computer and use it in GitHub Desktop.
Find all folders named ./components/[folder]/docs and copy contents to ./docs/components/[folder]
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 | |
find . | grep -E "^\./components/(.*)/docs$" | while read -r path; do | |
folder=$(echo "$path" | sed 's/^.\/components\(.*\)\/docs$/\1/') | |
mkdir -p ./docs/components/$folder | |
cp -r $path/* ./docs/components/$folder | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment