# HG changeset patch # User Christophe Lincoln # Date 1487795746 -3600 # Node ID 6d13228babae1bdcf7d22f79562eddc445e622d4 # Parent b4700d7f9d42d6d963c8ba503f9631b4d4c0f8c1 Dont show My bugs on profile if any created diff -r b4700d7f9d42 -r 6d13228babae web/plugins/mybugs/user.sh --- a/web/plugins/mybugs/user.sh Wed Feb 22 21:18:03 2017 +0100 +++ b/web/plugins/mybugs/user.sh Wed Feb 22 21:35:46 2017 +0100 @@ -3,19 +3,22 @@ # This script display bug for a given user. A copy is used on SCN to # display user bugs on profile page with a custom config file to set # $bugdir. -# +# [ -f "$plugins/mybugs/bugdir.conf" ] && . $plugins/mybugs/bugdir.conf [ "$(GET user)" ] && user="$(GET user)" +list="$(fgrep -l $user ${bugdir}/*/*/bug.conf | xargs ls -lt | awk '{print $9}')" -echo "

My bugs

" -echo "
"
-for bug in $(fgrep -l $user ${bugdir}/*/*/bug.conf | xargs ls -lt | awk '{print $9}')
-do
-	. ${bug}
-	id=$(basename $(dirname $bug))
-	cat << EOT
+if [ "$list" ]; then
+	echo "

My bugs

" + echo "
"
+	for bug in ${list}
+	do
+		. ${bug}
+		id=$(basename $(dirname $bug))
+		cat << EOT
  \
 Bug $id: $BUG - $DATE
 EOT
-done
-echo "
" + done + echo "
" +fi