]> git.mdlowis.com Git - projs/tide.git/commitdiff
updated TODO list and tfetch script
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 2 Oct 2018 03:35:47 +0000 (23:35 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 2 Oct 2018 03:35:47 +0000 (23:35 -0400)
TODO.md
tfetch

diff --git a/TODO.md b/TODO.md
index 8807eb8df38c3a5f9c0d5d242d7325231785b157..c70c3b0bc3c6d2087ff007b3888ba27a9f7c7531 100644 (file)
--- 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 24d47c8e471e6f128367a5e57a207370d1e5ba3c..cf78951014397f6ccf95c829f170c32b21f2a06d 100755 (executable)
--- 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
 
 #-------------------------------------------------------------------------------