From 105160334dc067d07d741a59bfd0d314a9dc6160 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 19 Nov 2016 17:07:38 +0100 Subject: [PATCH] themes: don't expect authors to be dirty --- admin/fill_exercices.sh | 2 +- libfic/theme.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/fill_exercices.sh b/admin/fill_exercices.sh index c4461d81..797c1352 100755 --- a/admin/fill_exercices.sh +++ b/admin/fill_exercices.sh @@ -70,7 +70,7 @@ get_dir "" | while read f; do basename "$f"; done | while read THEME_URI do THM_BASEURI="/${THEME_URI}/" THEME_NAME=$(echo "${THEME_URI#*-}" | unhtmlentities) - THEME_AUTHORS=$(get_file "${THM_BASEURI}/AUTHORS.txt" | sed 's/$/,/' | xargs) + THEME_AUTHORS=$(get_file "${THM_BASEURI}/AUTHORS.txt" | sed 's/$/, /' | tr -d '\n' | sed 's/, $//') THEME_ID=`new_theme "$THEME_NAME" "$THEME_AUTHORS"` if [ -z "$THEME_ID" ]; then echo -e "\e[31;01m!!! An error occured during theme add\e[00m" diff --git a/libfic/theme.go b/libfic/theme.go index fb6be3ac..7b2edeaa 100644 --- a/libfic/theme.go +++ b/libfic/theme.go @@ -104,7 +104,7 @@ func ExportThemes() (interface{}, error) { } ret[fmt.Sprintf("%d", theme.Id)] = exportedTheme{ theme.Name, - theme.Authors[:len(theme.Authors)-1], + theme.Authors, exos, } }