Last active
September 26, 2019 21:57
-
-
Save hlzhang/48860851bcb1c04432f3507bb20c2e5c to your computer and use it in GitHub Desktop.
Revisions
-
chshawkn revised this gist
Sep 26, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,8 @@ function fix_content_root() { echo ${target}; sed -Ei 's#<content url="file://\$MODULE_DIR\$/(\.\./)+src/main/resources" />##g' ${target}; sed -i '/<content url="file:\/\/$MODULE_DIR$\/..\/src\/main\/resources">/{:a;N;/<\/content>/!ba};/<sourceFolder url="file:\/\/$MODULE_DIR$\/..\/src\/main\/resources" type="java-resource" \/>/d' ${target}; sed -i '/<content url="file:\/\/$MODULE_DIR$\/..\/..\/src\/main\/resources">/{:a;N;/<\/content>/!ba};/<sourceFolder url="file:\/\/$MODULE_DIR$\/..\/..\/src\/main\/resources" type="java-resource" \/>/d' ${target}; sed -i '/<content url="file:\/\/$MODULE_DIR$\/..\/..\/..\/src\/main\/resources">/{:a;N;/<\/content>/!ba};/<sourceFolder url="file:\/\/$MODULE_DIR$\/..\/..\/..\/src\/main\/resources" type="java-resource" \/>/d' ${target}; done } -
chshawkn created this gist
Sep 22, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ set -x function fix_content_root() { local in_directory="$1" local targets=($(grep -E -l --include \*.iml '<content url="file://\$MODULE_DIR\$/(\.\./)+src/main/resources"' -r ${in_directory} | grep -v 'fixContentRoot.sh')) for target in ${targets[@]}; do echo ${target}; sed -Ei 's#<content url="file://\$MODULE_DIR\$/(\.\./)+src/main/resources" />##g' ${target}; sed -i '/<content url="file:\/\/$MODULE_DIR$\/..\/src\/main\/resources">/{:a;N;/<\/content>/!ba};/<sourceFolder url="file:\/\/$MODULE_DIR$\/..\/src\/main\/resources" type="java-resource" \/>/d' ${target}; done } fix_content_root "${HOME}/Documents/IdeaProjects"