mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Enabling feature w/ dependencies didn’t work from command-line
--HG-- branch : dev
This commit is contained in:
@@ -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)));
|
||||
|
Reference in New Issue
Block a user