Skip to content

Instantly share code, notes, and snippets.

@ejhayes
Last active December 10, 2015 23:18
Show Gist options
  • Save ejhayes/4507956 to your computer and use it in GitHub Desktop.
Save ejhayes/4507956 to your computer and use it in GitHub Desktop.
This is a pretty nasty way of finding schema.yaml files, renaming them based on directory structure, and moving them to a centralized schemas directory. The goal is to use this for future schema validation.
find beta -type f -name \*.yaml | xargs -I file echo file | sed "s/\(\([a-zA-Z\_]\+\)\/\([a-zA-Z\_]\+\).*\)/kwalify -lf \1 \3\/\2.yaml/" | sh && e=$(find beta -type f -name \*.yaml | xargs -I file echo file | sed "s/\(\([a-zA-Z\_]\+\)\/\([a-zA-Z\_]\+\).*\)/kwalify -lf \1 \3\/\2.yaml/" | sh ) && echo $e | grep -v INVALID
find modules -type f -name schema.yaml | xargs -I file echo file | sed "s/\(modules\/\([a-zA-Z\_]\+\)\/.*\)/\Lcp \1 schemas\/\2.yaml/" | sh
find beta -type f -name \*.yaml | xargs -I file echo file | sed "s/\(\([a-zA-Z\_]\+\)\/\([a-zA-Z\_]\+\).*\)/kwalify -lf \1 \3\/\2.yaml/" | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment