Hi, all! I need to resolve environment variables in a string. I'm not seeing a 
proc for this in the standard library, so I whipped this up:
    
    
    import os, strtabs
    
    proc envTable: StringTableRef =
      result = newStringTable(modeCaseSensitive)
      for key, value in envPairs():
        result[key] = value
    
    let
      envs = envTable()
      path = paramStr(1)
    
    echo path % envs
    
    
    Run

Is there a better or more idomatic way to do this?

Reply via email to