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