Sharp.Augeas/CodeLiturgy.Augeas/Program.cs

25 lines
784 B
C#
Raw Normal View History

2022-11-05 05:07:41 +03:00
using CodeLiturgy.Augeas;
using CodeLiturgy.Augeas.Test;
2022-11-04 03:40:02 +03:00
var path = Environment.CurrentDirectory;
var root = $"{path}/root/";
AugSettings augSettings = new AugSettings(root, "/opt/homebrew/share/augeas/lenses/dist");
2022-11-04 20:09:06 +03:00
2022-11-05 05:07:41 +03:00
var augeas = new Augeas(augSettings);
2022-11-04 20:09:06 +03:00
// Calling extern functions
string clSiteMatchPath = "/files/etc/apache2/sites-available/00-ci.codeliturgy.com.conf/VirtualHost";
string clSiteFilepath = "/etc/apache2/sites-available/00-ci.codeliturgy.com.conf";
2022-11-05 05:07:41 +03:00
//AugeasCore.Benchmark( () => augeasCore.PrintAugTree(clSiteMatchPath , clSiteFilepath), 10);
//AugeasCore.Benchmark( () => augeasCore.PrintPreview(clSiteMatchPath , clSiteFilepath), 10);
augeas.LoadFile(clSiteFilepath);
augeas.PrintAugTree(clSiteMatchPath);
var tree = augeas.GetTree(clSiteMatchPath);
2022-11-04 20:09:06 +03:00