Avoid code duplication Chocolatey Packages -



Avoid code duplication Chocolatey Packages -

introduction

multiple functions have been added chocolatey package.

these functions applied other chocolatey packages well.

this done copying functions each of them. however, if function optimized these changes needs copied packages.

question

how avoid code duplication in chocolatey packages?

i have few suggestions how proceed this...

(probably 1 take longest due dependency on other people) if these functions re-usable, yourself, , other people, suggest submitting pull request chocolatey core, add together these functions chocolatey. way, gets benefit. split functions separate file, , dot source them chocolatey packages creating. within source command repository, store file in mutual location, , add together each chocolatey bundle required. further refactor extracted .ps1 file, runs module create. create chocolatey bundle deploys powershell module (there examples of doing on chocolatey.org - shout if don't find one). then, in chocolatey bundle needs functions exported module, take depenedency on new chocolatey package, , import-module in consuming chocolatey package. the little known extensions. @ package: http://chocolatey.org/packages/devbox-common.extension

hope makes sense, , provides help!

gary

code-duplication chocolatey

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -