Core: improve title_path generation (remove non alphanum)

This commit is contained in:
Bertrand Benjamin 2022-10-27 10:29:26 +02:00
parent 6c5d74b53f
commit 6a2b1f73a5

View File

@ -45,7 +45,7 @@ esac
exec 3>&1 exec 3>&1
cd $tribe cd $tribe
existing_seq=$(ls -d */) existing_seq=$(ls -d [0-9][0-9]_*)
nbr_seq=$(echo $existing_seq | wc -w) nbr_seq=$(echo $existing_seq | wc -w)
next_seq_number=$(expr $nbr_seq) next_seq_number=$(expr $nbr_seq)
@ -94,7 +94,7 @@ case $selection in
esac esac
title_path=$(echo ${title// /_} | iconv -f utf8 -t ascii//TRANSLIT) title_path=$(echo ${title// /_} | iconv -f utf8 -t ascii//TRANSLIT | tr -cd '[:alnum:]._-')
sequence_path=$tribe/$(printf "%02d" $next_seq_number)_${title_path}/ sequence_path=$tribe/$(printf "%02d" $next_seq_number)_${title_path}/
mkdir -p $sequence_path mkdir -p $sequence_path