Example #1
0
        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));
        }
Example #2
0
 public override void Execute(XElement model, Context ctx)
 {
     if (string.IsNullOrEmpty(rest))
     {
         Std.Info("");
     }
     else
     {
         var expanded = ExpandVars(rest, model, ctx);
         Std.Info(expanded);
     }
 }
Example #3
0
        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();
        }