From e71e2ae5791e69a72d927e0b66185a30f17bf124 Mon Sep 17 00:00:00 2001 From: James Tomasino Date: Mon, 28 Jan 2019 22:59:02 -0500 Subject: [PATCH] added a config option for gophernicus setting, defaulted to true --- burrow | 15 +++++++++++++-- burrow.1 | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/burrow b/burrow index 207476c..30c251a 100755 --- a/burrow +++ b/burrow @@ -1,6 +1,6 @@ #!/bin/sh -version="v1.7.6" +version="v1.7.7" configfiles="/etc/burrow/config $HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow" @@ -21,6 +21,7 @@ config_gopher_desc="Description" config_rss_num_entries="10" config_phlog_autorss=false config_gophermap_omitserver=false +config_gophernicus=true # coreutils function wrappers stat_func () { @@ -247,7 +248,11 @@ make_post_process_formatting () { if [ $config_autoindent ]; then temp_post=$(mktemp -t "$(basename "$0").post.XXXXXXX") || \ die "Failed to create temporary file" 1 - awk -v server="${config_gopher_server}" -v port="${config_gopher_port}" '/(^[0-9cdghisGIT;\+].*\t|^[=\*\%\#\!\:\~\.].*)/ {print $0; next} {print "i" $0 "\t\t" server "\t" port}' "$post_file" > "${temp_post}" + if [ $config_gophernicus ]; then + awk -v server="${config_gopher_server}" -v port="${config_gopher_port}" '/(^[0-9cdghisGIT;\+].*\t|^[=\*\%\#\!\-\:\~\.].*)/ {print $0; next} {print "i" $0 "\t\t" server "\t" port}' "$post_file" > "${temp_post}" + else + awk -v server="${config_gopher_server}" -v port="${config_gopher_port}" '/^[0-9cdghisGIT;\+].*\t/ {print $0; next} {print "i" $0 "\t\t" server "\t" port}' "$post_file" > "${temp_post}" + fi # create post file normally to respect umask touch "${post_file}" cat "${temp_post}" > "${post_file}" @@ -584,6 +589,11 @@ quickstart () { read -r config_gopher_port printf "Root directory of your gopher site? " read -r config_gopher_root + if yesno "Is your gopher server 'gophernicus'? "; then + config_gophernicus=true + else + config_gophernicus=false + fi # add trailing slash if missing config_gopher_root="${config_gopher_root%/}/" if yesno "Create a phlog? "; then @@ -654,6 +664,7 @@ create_config () { printf "config_git_push=%s\\n" "$config_git_push" printf "\\n" printf "config_autoindent=%s\\n" "$config_autoindent" + printf "config_gophernicus=%s\\n" "$config_gophernicus" printf "\\n" printf "config_file_rss=\"%s\"\\n" "$config_file_rss" printf "config_gopher_name=\"%s\"\\n" "$config_gopher_name" diff --git a/burrow.1 b/burrow.1 index bf2ce9b..f9e357f 100644 --- a/burrow.1 +++ b/burrow.1 @@ -1,4 +1,4 @@ -.TH BURROW 1 "27 Jan 2019" "version 1.7.6" +.TH BURROW 1 "28 Jan 2019" "version 1.7.7" .SH NAME burrow \- a helper for building and managing a gopher hole .SH SYNOPSIS