Skip to content

Commit

Permalink
fix issue if 'Extensions' directory doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfuller committed Jul 26, 2010
1 parent 0d13ec3 commit 2659d73
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Pomodo7o/Program.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Windows;
using StructureMap;

Expand Down Expand Up @@ -30,8 +29,12 @@ static void Main()
cfg.Scan(scanner =>
{
scanner.AssembliesFromPath("Extensions");
scanner.AddAllTypesOf<IPomodoroPublisher>();
var extensionDir = "Extensions";
if (Directory.Exists(extensionDir))
{
scanner.AssembliesFromPath(extensionDir);
scanner.AddAllTypesOf<IPomodoroPublisher>();
}
});
cfg.For<IPomodoroPublisher>().Singleton().AddInstances(x =>
Expand Down

0 comments on commit 2659d73

Please sign in to comment.