choco icon indicating copy to clipboard operation
choco copied to clipboard

new - allow absolute or relative paths for templates

Open Pilskalns opened this issue 7 years ago • 6 comments

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.

Pilskalns avatar Jan 24 '18 16:01 Pilskalns

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

Pilskalns avatar Jan 31 '18 18:01 Pilskalns

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"

ferventcoder avatar Feb 01 '18 04:02 ferventcoder

Hey, long time user, first time contributor here. Can I pick up this issue?

david-proctor avatar Jul 25 '18 20:07 david-proctor

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.

ferventcoder avatar Sep 26 '18 03:09 ferventcoder

Any chance this will get any more attention? I would make creating packaging a whole lot easier.

henryborchers avatar Mar 11 '24 22:03 henryborchers

@henryborchers this isn't something we're working on just now or has been prioritised. There is currently a workaround above.

pauby avatar Mar 12 '24 07:03 pauby