testing hidden config switch config_gophermap_omitserver

This commit is contained in:
James Tomasino 2018-05-01 18:42:22 -04:00
parent 2acf982073
commit 4d08e72352
1 changed files with 57 additions and 27 deletions

84
burrow
View File

@ -26,6 +26,7 @@ config_gopher_name="My Gopher Hole"
config_gopher_desc="Description" config_gopher_desc="Description"
config_rss_num_entries="10" config_rss_num_entries="10"
config_phlog_autorss=false config_phlog_autorss=false
config_gophermap_omitserver=false
# coreutils function wrappers # coreutils function wrappers
stat_func () { stat_func () {
@ -240,41 +241,70 @@ make_post_gophermap () {
# Add appropriate link into temp gophermap # Add appropriate link into temp gophermap
if $use_gophermap; then if $use_gophermap; then
if $use_date; then if $use_date; then
# if using gophermap and date if $config_gophermap_omitserver; then
printf "1%s - %s\\t%s\\t%s\\t%s\\n" \ # if using gophermap and date, no server
"$(date +%Y-%m-%d)" \ printf "1%s - %s\\t%s\\n" \
"$title" \ "$(date +%Y-%m-%d)" \
"$post_file_path" \ "$title" \
"$config_gopher_server" \ "$post_file_path" > "$temp_gophermap"
"$config_gopher_port" > "$temp_gophermap" else
# if using gophermap and date
printf "1%s - %s\\t%s\\t%s\\t%s\\n" \
"$(date +%Y-%m-%d)" \
"$title" \
"$post_file_path" \
"$config_gopher_server" \
"$config_gopher_port" > "$temp_gophermap"
fi
else else
# if using gophermap but not date if $config_gophermap_omitserver; then
printf "1%s\\t%s\\t%s\\t%s\\n" \ # if using gophermap but not date, no server
"$title" \ printf "1%s\\t%s\\n" \
"$post_file_path" \ "$title" \
"$config_gopher_server" \ "$post_file_path" > "$temp_gophermap"
"$config_gopher_port" > "$temp_gophermap" else
# if using gophermap but not date
printf "1%s\\t%s\\t%s\\t%s\\n" \
"$title" \
"$post_file_path" \
"$config_gopher_server" \
"$config_gopher_port" > "$temp_gophermap"
fi
fi fi
else else
if $use_date; then if $use_date; then
# if not using gophermap but using date if $config_gophermap_omitserver; then
printf "0%s - %s\\t%s\\t%s\\t%s\\n" \ # if not using gophermap but using date, no server
"$(date +%Y-%m-%d)" \ printf "0%s - %s\\t%s\\n" \
"$title" \ "$(date +%Y-%m-%d)" \
"$post_file_path" \ "$title" \
"$config_gopher_server" \ "$post_file_path" > "$temp_gophermap"
"$config_gopher_port" > "$temp_gophermap" else
# if not using gophermap but using date
printf "0%s - %s\\t%s\\t%s\\t%s\\n" \
"$(date +%Y-%m-%d)" \
"$title" \
"$post_file_path" \
"$config_gopher_server" \
"$config_gopher_port" > "$temp_gophermap"
fi
else else
# if not using gophermap or date if $config_gophermap_omitserver; then
printf "0%s\\t%s\\t%s\\t%s\\n" \ # if not using gophermap or date, no server
"$title" \ printf "0%s\\t%s\\n" \
"$post_file_path" \ "$title" \
"$config_gopher_server" \ "$post_file_path" > "$temp_gophermap"
"$config_gopher_port" > "$temp_gophermap" else
# if not using gophermap or date
printf "0%s\\t%s\\t%s\\t%s\\n" \
"$title" \
"$post_file_path" \
"$config_gopher_server" \
"$config_gopher_port" > "$temp_gophermap"
fi
fi fi
fi fi
cat "$type_gophermap" >> "$temp_gophermap" cat "$type_gophermap" >> "$temp_gophermap"
if ! $use_date; then if ! $use_date; then
sort -fk 1.2 "$temp_gophermap" -o "$temp_gophermap" sort -fk 1.2 "$temp_gophermap" -o "$temp_gophermap"