choco
choco copied to clipboard
new - allow absolute or relative paths for templates
Currently, Chocolatey expects package templates to be placed in C:\ProgramData\chocolatey\templates\<templateName>
It would be very practical to allow also use of relative or absolute paths. Why? It's easier to git-version package template together in the same location with code.
Also, to run code editor on file inside ProgramData
needs editor to be launched in elevated mode.
P.S. Currently possible hack/work-around is to use choco new "$package" -t "..\..\..\Path\From\Root\<templateName>"
but it doesn't allow jump to another drive.
Same day later I figured better workaround...
# UPDATE TEMPLATE TO CHOCO WORK DIRECTORY
New-Item C:\ProgramData\chocolatey\templates -type directory -force | out-null
if(Test-Path C:\ProgramData\chocolatey\templates\$template){
Remove-Item C:\ProgramData\chocolatey\templates\$template -recurse
}
Copy-Item setup\chocotemplate C:\ProgramData\chocolatey\templates\$template -recurse
Gets executed from build script inside git directory
Howdy! I meant to comment when I saw this come across my email but this sounds like a great idea! I've set it up for "Up For Grabs"
Hey, long time user, first time contributor here. Can I pick up this issue?
There is a related issue at #1637, I think we'll want to close the other one as a duplicate as this already provides a PR.
Any chance this will get any more attention? I would make creating packaging a whole lot easier.
@henryborchers this isn't something we're working on just now or has been prioritised. There is currently a workaround above.