fix: allow Nitride.Temporal to be used twice
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
D. Moonfire 2023-09-03 18:51:56 -05:00
parent ddebc8e683
commit d258e52697
4 changed files with 20 additions and 4 deletions

View file

@ -100,6 +100,7 @@ release-tag: release-setup
#!/usr/bin/env bash
set -euxo pipefail
git remote remove publish || true
git remote add publish https://dmoonfire:$GITEA_TOKEN@src.mfgames.com/mfgames-cil/$(basename $(git config --get remote.origin.url))
for i in src/*/GitVersion.yml

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />

View file

@ -4,17 +4,32 @@ namespace MfGames.Nitride.Temporal.Setup;
public class NitrideTemporalModule : Module
{
private static bool loaded;
/// <inheritdoc />
protected override void Load(ContainerBuilder builder)
{
// Make sure our module isn't loaded more than once. This can happen
// if another module requires this one and the user adds this module
// to customize settings.
if (loaded)
{
return;
}
loaded = true;
// Make sure our module isn't loaded more than once.
builder.RegisterOperators(this);
builder.RegisterValidators(this);
builder.RegisterType<TimeService>()
builder
.RegisterType<TimeService>()
.AsSelf()
.SingleInstance();
builder.RegisterGeneric(typeof(SetInstantFromComponent<>))
builder
.RegisterGeneric(typeof(SetInstantFromComponent<>))
.As(typeof(SetInstantFromComponent<>));
}
}

View file

@ -32,7 +32,7 @@ public class BuildCommand : Command, ICommandHandler
this.Handler = this;
// Handle any injected arguments into the command line.
foreach (IPipelineCommandOption? option in pipelineOptions)
foreach (IPipelineCommandOption option in pipelineOptions)
{
this.AddOption(option.Option);
}