Skip to content

Commit

Permalink
feat: stage files found by watch command silently
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavisau committed Feb 23, 2023
1 parent 0dcbb53 commit 5369df3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -130,7 +130,7 @@ private Task HandleWatchCommand(string cmd, string[] args)

foreach (var file in filesInPath)
if (TryGetChangedFile(file) is {} cf)
_manualWatchFiles.OnNext(cf);
_manualWatchFiles.OnNext(cf with { Silent = true });

return Task.CompletedTask;
}
Expand Down
Expand Up @@ -2,13 +2,15 @@

namespace Tbc.Host.Components.FileWatcher.Models
{
public class ChangedFile
public record ChangedFile
{
public required string Path { get; init; }
public required string Contents { get; init; }
public DateTimeOffset ChangedAt { get; init; }
= DateTimeOffset.Now;

public bool Silent { get; set; }

public override string ToString()
{
return $"{Path} ({ChangedAt})";
Expand Down
Expand Up @@ -8,7 +8,7 @@ namespace Tbc.Host.Components.IncrementalCompiler
public interface IIncrementalCompiler
{
List<string> StagedFiles { get; }
EmittedAssembly? StageFile(ChangedFile file) => StageFile(file, false);
EmittedAssembly? StageFile(ChangedFile file) => StageFile(file, file.Silent);
EmittedAssembly? StageFile(ChangedFile file, bool silent = false);
void AddMetadataReference(AssemblyReference asm);
void ClearReferences();
Expand Down

0 comments on commit 5369df3

Please sign in to comment.