Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for publishing UICatalog as single file #3074

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion UICatalog/Scenarios/Animation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ public override void Setup ()
};
Win.Add (lbl2);

var dir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location));
DirectoryInfo dir;

var assemblyLocation = Assembly.GetExecutingAssembly ().Location;

if (!string.IsNullOrEmpty (assemblyLocation)) {
dir = new DirectoryInfo (Path.GetDirectoryName (assemblyLocation));
} else {
dir = new DirectoryInfo (System.AppContext.BaseDirectory);
}

var f = new FileInfo (
Path.Combine (dir.FullName, "Scenarios", "Spinning_globe_dark_small.gif"));
Expand Down
16 changes: 13 additions & 3 deletions UICatalog/UICatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,18 @@ static void StartConfigFileWatcher ()
{
// Setup a file system watcher for `./.tui/`
_currentDirWatcher.NotifyFilter = NotifyFilters.LastWrite;
var f = new FileInfo (Assembly.GetExecutingAssembly ().Location);
string tuiDir = Path.Combine (f.Directory!.FullName, ".tui");

var assemblyLocation = Assembly.GetExecutingAssembly ().Location;
string tuiDir;

if (!string.IsNullOrEmpty (assemblyLocation)) {
var assemblyFile = new FileInfo (assemblyLocation);
tuiDir = Path.Combine (assemblyFile.Directory!.FullName, ".tui");
} else {
tuiDir = Path.Combine (System.AppContext.BaseDirectory, ".tui");
}



if (!Directory.Exists (tuiDir)) {
Directory.CreateDirectory (tuiDir);
Expand All @@ -158,7 +168,7 @@ static void StartConfigFileWatcher ()

// Setup a file system watcher for `~/.tui/`
_homeDirWatcher.NotifyFilter = NotifyFilters.LastWrite;
f = new FileInfo (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile));
var f = new FileInfo (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile));
tuiDir = Path.Combine (f.FullName, ".tui");

if (!Directory.Exists (tuiDir)) {
Expand Down