Created
January 17, 2019 12:56
-
-
Save TheBiggerGuy/b6222bd4784b264dbd00411a654f537c to your computer and use it in GitHub Desktop.
Fix Windows vs. Linux/OSX/POSIX case sensitive filename issues with Microsoft .NET resource files (resx)
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 | |
set -o errexit # Exit on most errors (see the manual) | |
set -o errtrace # Make sure any error trap is inherited | |
set -o nounset # Disallow expansion of unset variables | |
set -o pipefail # Use last non-zero exit code in a pipeline | |
#set -o xtrace # Trace the execution of the script (debug) | |
root="${PWD}" | |
for resfile in */*.resx ; do | |
resfilereal=$(realpath ${resfile}) | |
resfiledir=$(dirname ${resfile}) | |
echo "Found Resex file ${resfile}" #(resfilereal=${resfilereal} resfiledir=${resfiledir}" | |
cd "${resfiledir}" | |
find * -type f -print0 | sed -e 's/\//\\\/\\\//g' | sed -e 's/\./\\\\./g' | xargs -0 --no-run-if-empty --replace="." -I{} sed --in-place 's/>{};/>{};/gI' "${resfilereal}" | |
cd "${root}" | |
dos2unix "${resfilereal}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment