Skip to content

Instantly share code, notes, and snippets.

@szhu
Created July 27, 2018 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szhu/e82aba9fa20e680972efe5f6b4158275 to your computer and use it in GitHub Desktop.
Save szhu/e82aba9fa20e680972efe5f6b4158275 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
mkdir -p tmp/overrides/webpack%3a/%2e
while true; do
while IFS= read -r -d '' override_file
do
file=$(echo "$override_file" | python -c 'import re, sys; print re.split("^tmp/overrides/webpack%3a/%2e/|%3f.*$", sys.stdin.read().strip())[1]')
cp -f "$override_file" "$file"
rm "$override_file"
echo "$file"
done < <(find tmp/overrides/webpack%3a/%2e -type f -print0)
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment