mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-18 17:47:54 +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.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)));
|
||||||
|
Reference in New Issue
Block a user