Skip to content

Instantly share code, notes, and snippets.

@devpilot
Created November 17, 2021 10:01
Show Gist options
  • Save devpilot/3cb9c71a03e521362843fcdb312b3ece to your computer and use it in GitHub Desktop.
Save devpilot/3cb9c71a03e521362843fcdb312b3ece to your computer and use it in GitHub Desktop.
find and replace from build files
#!/bin/bash
buildFiles="build/static/js/*.chunk.js"
confFile="$(pwd)/client.conf"
while read -r line;do
key=$(echo "$line" | cut -d = -f 1)
value=$(echo "$line" | cut -d = -f 2)
sed -i "s|$key|$value|g" $buildFiles
done < $confFile
echo "Configuration applied from file"
# exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment