diff --git a/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 b/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 index fecdb33171..90b01b522f 100644 --- a/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 +++ b/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 @@ -47,7 +47,7 @@ $commandOptions = @{ outdated = "-? --source='' --user= --password=" + $allcommands upgrade = "-y -whatif -? --pre --version= --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user= --password= --prerelease --forcex86 --not-silent --package-parameters='' --allow-downgrade --allow-multiple-versions --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums" + $allcommands + $proInstallUpgradeOptions uninstall = "-y -whatif -? --force-dependencies --remove-dependencies --all-versions --source='windowsfeatures' --source='webpi' --version= --uninstall-arguments='' --override-arguments --not-silent --params='' --package-parameters='' --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts" + $allcommands - new = "--template-name= --file='Biz editions only' --automaticpackage --version= --maintainer='' packageversion= maintainername='' maintainerrepo='' installertype= url='' url64='' silentargs='' -?" + $allcommands + new = "--template-name= --file='Biz editions only' --automaticpackage --version= --maintainer='' packageversion= maintainername='' maintainerrepo='' installertype= url='' url64='' silentargs='' --use-built-in-template -?" + $allcommands pack = "--version= -?" + $allcommands push = "--source='' --api-key= --timeout= -?" + $allcommands source = "--name= --source='' --user= --password= --priority= -?" + $allcommands diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs index d84f307be8..3f3b0a0064 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs @@ -60,7 +60,10 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon option => configuration.NewCommand.TemplateProperties.Add(TemplateValues.MaintainerPropertyName, option.remove_surrounding_quotes())) .Add("outputdirectory=", "OutputDirectory - Specifies the directory for the created Chocolatey package file. If not specified, uses the current directory.", - option => configuration.OutputDirectory = option) + option => configuration.OutputDirectory = option) + .Add("built-in|built-in-template|originaltemplate|original-template|use-original-template|use-built-in-template", + "BuiltInTemplate - Use the original built-in template instead of any override. Available in 0.9.10+.", + option => configuration.NewCommand.UseOriginalTemplate = option != null) ; //todo: more built-in templates } diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index 4cedf855fb..a56f0ca0ed 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -391,6 +391,7 @@ public NewCommandConfiguration() public string Name { get; set; } public bool AutomaticPackage { get; set; } public IDictionary TemplateProperties { get; private set; } + public bool UseOriginalTemplate { get; set; } } [Serializable] diff --git a/src/chocolatey/infrastructure.app/services/TemplateService.cs b/src/chocolatey/infrastructure.app/services/TemplateService.cs index 61ead66986..e64ea61f0b 100644 --- a/src/chocolatey/infrastructure.app/services/TemplateService.cs +++ b/src/chocolatey/infrastructure.app/services/TemplateService.cs @@ -92,7 +92,7 @@ public void generate(ChocolateyConfiguration configuration) } var defaultTemplateOverride = _fileSystem.combine_paths(ApplicationParameters.TemplatesLocation, "default"); - if (string.IsNullOrWhiteSpace(configuration.NewCommand.TemplateName) && !_fileSystem.directory_exists(defaultTemplateOverride)) + if (string.IsNullOrWhiteSpace(configuration.NewCommand.TemplateName) && (!_fileSystem.directory_exists(defaultTemplateOverride) || configuration.NewCommand.UseOriginalTemplate)) { generate_file_from_template(configuration, tokens, NuspecTemplate.Template, _fileSystem.combine_paths(packageLocation, "{0}.nuspec".format_with(tokens.PackageNameLower)), Encoding.UTF8); generate_file_from_template(configuration, tokens, ChocolateyInstallTemplate.Template, _fileSystem.combine_paths(packageToolsLocation, "chocolateyinstall.ps1"), Encoding.UTF8);