34 references to AllowRunScripts
Microsoft.TemplateEngine.Cli (9)
Commands\create\TemplateCommand.cs (3)
104
AllowScriptsOption = new Option<
AllowRunScripts
>("--allow-scripts")
108
DefaultValueFactory = (_) =>
AllowRunScripts
.Prompt
118
internal Option<
AllowRunScripts
>? AllowScriptsOption { get; }
Commands\create\TemplateCommandArgs.cs (1)
67
public
AllowRunScripts
? AllowScripts { get; }
PostActionDispatcher.cs (4)
69
internal PostActionExecutionStatus Process(ITemplateCreationResult creationResult, bool isDryRun,
AllowRunScripts
canRunScripts)
125
if (canRunScripts ==
AllowRunScripts
.No)
135
else if (canRunScripts ==
AllowRunScripts
.Yes)
139
else if (canRunScripts ==
AllowRunScripts
.Prompt)
TemplateInvoker.cs (1)
312
PostActionExecutionStatus result = _postActionDispatcher.Process(creationResult, args.IsDryRun, args.AllowScripts ??
AllowRunScripts
.Prompt);
Microsoft.TemplateEngine.Cli.UnitTests (25)
ParserTests\InstantiateTests.cs (8)
559
[InlineData("foo",
AllowRunScripts
.Prompt)]
560
[InlineData("foo --allow-scripts prompt",
AllowRunScripts
.Prompt)]
561
[InlineData("foo --allow-scripts Prompt",
AllowRunScripts
.Prompt)]
562
[InlineData("foo --allow-scripts yes",
AllowRunScripts
.Yes)]
563
[InlineData("foo --allow-scripts Yes",
AllowRunScripts
.Yes)]
564
[InlineData("foo --allow-scripts no",
AllowRunScripts
.No)]
565
[InlineData("foo --allow-scripts NO",
AllowRunScripts
.No)]
566
internal void CanParseAllowScriptsOption(string command,
AllowRunScripts
? result)
PostActionDispatcherTests.cs (17)
43
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);
74
var result = dispatcher.Process(templateCreationResult, isDryRun: true,
AllowRunScripts
.Prompt);
100
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);
131
var result = dispatcher.Process(templateCreationResult, isDryRun: true,
AllowRunScripts
.Prompt);
161
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);
187
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Yes);
228
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Yes);
276
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Yes);
312
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Yes);
344
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.No);
375
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);
408
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);
440
var result = dispatcher.Process(templateCreationResult, isDryRun: true,
AllowRunScripts
.Prompt);
442
result = dispatcher.Process(templateCreationResult, isDryRun: true,
AllowRunScripts
.Yes);
444
result = dispatcher.Process(templateCreationResult, isDryRun: true,
AllowRunScripts
.No);
485
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);
528
var result = dispatcher.Process(templateCreationResult, isDryRun: false,
AllowRunScripts
.Prompt);