Skip to content

Instantly share code, notes, and snippets.

@floehopper
Created December 20, 2025 16:17
Show Gist options
  • Select an option

  • Save floehopper/7dc8a32d0f8a56d2430372f0ba40d00d to your computer and use it in GitHub Desktop.

Select an option

Save floehopper/7dc8a32d0f8a56d2430372f0ba40d00d to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
SRC_ROOT="???"
DST_ROOT="???"
find "$SRC_ROOT" \
\( -type d -name node_modules -prune \) -o \
\( -mindepth 4 -maxdepth 4 -type f -name "master.key" \
-print \) | while read -r file; do
relpath="${file#$SRC_ROOT/}"
dest="$DST_ROOT/$relpath"
mkdir -p "$(dirname "$dest")"
cp "$file" "$dest"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment