From 5558f18e86ecfd12e73a8ec6d8776c522be90dd6 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 1 Oct 2018 23:35:47 -0400 Subject: [PATCH] updated TODO list and tfetch script --- TODO.md | 2 +- tfetch | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/TODO.md b/TODO.md index 8807eb8..c70c3b0 100644 --- a/TODO.md +++ b/TODO.md @@ -2,8 +2,8 @@ ## STAGING -* Font tag should only change font in edit region * centering logic in view.c seems broken +* Font tag should only change font in edit region, not tags region * implement new version of tfetch (plumb) * implement tide registrar * implement tctl command diff --git a/tfetch b/tfetch index 24d47c8..cf78951 100755 --- a/tfetch +++ b/tfetch @@ -4,7 +4,10 @@ # Function Definitions #------------------------------------------------------------------------------- def expand(str) - str + str = str.gsub /\$(\$|[a-zA-Z0-9]+)/ do |match| + text = ("$" == match[1..-1] ? "$" : (ENV[match[1..-1]] || "")) + end + #(str.match('[ \t\r\n]') ? "'#{str.gsub('\\','\\\\')}'" : str) end def rule(&block) @@ -46,7 +49,7 @@ def is_file(path) end def set(var, val) - ENV[var] = val + ENV[var] = expand(val) end def unset(var) @@ -54,9 +57,11 @@ def unset(var) end def exec(cmd) - if not system(cmd) then - raise "command failed" - end + require 'pp' + pp expand(cmd) + #if not system(expand(cmd)) then + # raise "command failed" + #end end def launch(cmd) @@ -64,9 +69,7 @@ def launch(cmd) end def import(path) - if File.file?(expand(path)) then - load(path) - end + load(path) if File.file?(expand(path)) end #------------------------------------------------------------------------------- -- 2.54.0