public static string Load(string scriptPath) { Std.Info($"Running script '{scriptPath}'"); if (!File.Exists(scriptPath)) { throw new ScriptException($"Cannot file script '{scriptPath}'"); } return(File.ReadAllText(scriptPath)); }
public override void Execute(XElement model, Context ctx) { if (string.IsNullOrEmpty(rest)) { Std.Info(""); } else { var expanded = ExpandVars(rest, model, ctx); Std.Info(expanded); } }
public override void Execute(XElement model, Context ctx) { var newFilename = ExpandVars(_quoted, model, ctx); EnsureFolderExists(newFilename); Std.Info($"Output is '{newFilename}'"); var old = ctx.Output; ctx.Output = new StreamWriter(newFilename, append: false); old.Flush(); old.Close(); }