summaryrefslogtreecommitdiff
path: root/Meta/refresh-serenity-qtcreator.sh
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-08-15 13:03:56 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-15 13:38:24 +0200
commitf19b88c96518176e962b487baf7937ceacf1f235 (patch)
tree5f35a67d32e71daab9b94e47e618ac0ffa386128 /Meta/refresh-serenity-qtcreator.sh
parentcebf8ae3b72cd54d42a570c27612892022700fb2 (diff)
downloadserenity-f19b88c96518176e962b487baf7937ceacf1f235.zip
Meta: Don't require setting SERENITY_ROOT for refresh script
The need for SERENITY_ROOT was basically eliminated in 73c953b674c9caad40f3bf77dc44c229ef48bc0d. The existing guess 'git rev-parse --show-toplevel' should be correct in all conceivable cases. Most code just assumes the layout in git, or depends on SERENITY_ROOT as set in the CMakeLists.txt. *Requiring* the user to set it doesn't make sense anymore. While I was in there anyway, I added exit code propagation. Also, 'find' should be a tad faster now, because it doesn't enumerate files in the large ignored directories Build/ and Toolchain/ anymore.
Diffstat (limited to 'Meta/refresh-serenity-qtcreator.sh')
-rwxr-xr-xMeta/refresh-serenity-qtcreator.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/Meta/refresh-serenity-qtcreator.sh b/Meta/refresh-serenity-qtcreator.sh
index 5666f0f52f..d8c95ed95a 100755
--- a/Meta/refresh-serenity-qtcreator.sh
+++ b/Meta/refresh-serenity-qtcreator.sh
@@ -1,8 +1,14 @@
#!/bin/sh
+set -e
+
if [ -z "$SERENITY_ROOT" ]
-then echo "Serenity root not set. Please set environment variable first. E.g. export SERENITY_ROOT=$(git rev-parse --show-toplevel)"
+then
+ SERENITY_ROOT="$(git rev-parse --show-toplevel)"
+ echo "Serenity root not set. This is fine! Other scripts may require you to set the environment variable first, e.g.:"
+ echo " export SERENITY_ROOT=${SERENITY_ROOT}"
fi
-cd "$SERENITY_ROOT" || exit 1
-find . -name '*.ipc' -or -name '*.cpp' -or -name '*.idl' -or -name '*.c' -or -name '*.h' -or -name '*.S' -or -name '*.css' | grep -Fv Patches/ | grep -Fv Root/ | grep -Fv Ports/ | grep -Fv Toolchain/ | grep -Fv Base/ > serenity.files
+cd "$SERENITY_ROOT"
+
+find . \( -name Base -o -name Patches -o -name Ports -o -name Root -o -name Toolchain \) -prune -o \( -name '*.ipc' -or -name '*.cpp' -or -name '*.idl' -or -name '*.c' -or -name '*.h' -or -name '*.S' -or -name '*.css' \) -print > serenity.files