diff --git a/twtxt-c b/twtxt-c index fb69d7e..a56f72b 100755 --- a/twtxt-c +++ b/twtxt-c @@ -34,23 +34,20 @@ case $1 in -* | --*) usage; error_exit "unknown option $1" ;; init) - read -p "Your desired nickname [$USER]: " nickname + read -p "Your desired nickname [$USER]: " nick nick=${nick:-"$USER"} read -p "Type path to your twtxt [/home/$USER/twtxt.txt]: " path_to_twtxt - twtxt=${path_to_twtxt:-"/home/$USER/twtxt.txt"} + path_to_twtxt=${path_to_twtxt:-"/home/$USER/twtxt.txt"} echo "" >> $path_to_twtxt read -p "Type path to your twtxt config folder [/home/$USER/.config/twtxt-c/]: " config config=${config:-"/home/$USER/.config/twtxt-c/"} mkdir -p $config read -p "URL to twtxt [https://example.com/twtxt.txt]: " url url=${url:-"https://example.com/twtxt.txt"} - printf "[twtxt]\n - nick = %s\n - twtfile = %s\n - url = %s\n" "$nick" "$twtxt" "$url" >> $config + printf "[twtxt]\n nick = %s\n twtfile = %s\n url = %s\n" "$nick" "$path_to_twtxt" "$url" >> $config/config ;; tweet) - export config=/home/g1n/.config/twtxt/config + export config=/home/$USER/.config/twtxt-c/config printf "%s\t%s\n" "$(date +'%FT%T%:z')" "$2" >> $(awk '/twtfile/ {print $3}' $config) ;; *)