Enabling feature w/ dependencies didn’t work from command-line

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-07-19 15:16:15 -07:00
parent 3e9c9971bf
commit 20b783c2aa

View File

@@ -1,14 +1,17 @@
using System.Collections.Generic;
using System.Linq;
using Orchard.Commands;
using Orchard.UI.Notify;
using Orchard.Utility.Extensions;
namespace Orchard.Modules.Commands {
public class FeatureCommand : DefaultOrchardCommandHandler {
private readonly IModuleService _moduleService;
private readonly INotifier _notifier;
public FeatureCommand(IModuleService moduleService) {
public FeatureCommand(IModuleService moduleService, INotifier notifier) {
_moduleService = moduleService;
_notifier = notifier;
}
[OrchardSwitch]
@@ -59,8 +62,10 @@ namespace Orchard.Modules.Commands {
}
}
if (featuresToEnable.Count != 0) {
_moduleService.EnableFeatures(featuresToEnable);
Context.Output.WriteLine(T("Enabled features {0}", string.Join(",", featuresToEnable)));
_moduleService.EnableFeatures(featuresToEnable, true);
foreach(var entry in _notifier.List()) {
Context.Output.WriteLine(entry.Message);
}
}
else {
Context.Output.WriteLine(T("Could not enable features: {0}", string.Join(",", featureNames)));