Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Add exitcodes #210

Closed
wants to merge 4 commits into from
Closed

Conversation

rismoney
Copy link
Contributor

@rismoney rismoney commented Dec 6, 2012

Chocolatey needs to exit with an error code of 1 if there is a problem encountered during a chocolatey run. This should bubble up from posh or cmd calls, within posh or cmd.

@rismoney
Copy link
Contributor Author

rismoney commented Dec 7, 2012

It is worthy to note, that the Invoke-ChocolateyFunction will give free bubble up throws in any function. Basically using a splatting array we can use it to wrap any function and not worry about try/catching it. I actually wrapped all the chocolatey.ps1 callouts, and then we can throw at will.

@rismoney
Copy link
Contributor Author

didn't realize i needed a rebase. should be good to merge now.

@rismoney
Copy link
Contributor Author

wow this a royal pita to resolve conflicts! Will retest tomorrow, and we gotta get this in.

@ferventcoder
Copy link
Contributor

It usually gets worse on resolving conflicts if the history line is messed
up in any way. It's already a fun enough experience when a rebase has
conflicts...

On Friday, April 19, 2013, Rich Siegel wrote:

wow this a royal pita to resolve conflicts! Will retest tomorrow, and we
gotta get this in.


Reply to this email directly or view it on GitHubhttps://github.com//pull/210#issuecomment-16636826
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@rismoney
Copy link
Contributor Author

the history line was fine. it just gets confusing as to what to keep and what to shed, especially if you havent look at a branch in months, and the conflicts occur on the same lines or moved around.

@ferventcoder
Copy link
Contributor

Depends on your diff/merge tool as well.

On Friday, April 19, 2013, Rich Siegel wrote:

the history line was fine. it just gets confusing as to what to keep and
what to shed, especially if you havent look at a branch in months, and the
conflicts occur on the same lines or moved around.


Reply to this email directly or view it on GitHubhttps://github.com//pull/210#issuecomment-16637003
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@rismoney
Copy link
Contributor Author

what are you using?

@ferventcoder
Copy link
Contributor

Beyond compare 3 pro. Highly recommended and well worth $50. I use it
constantly every day.

On Friday, April 19, 2013, Rich Siegel wrote:

what are you using?


Reply to this email directly or view it on GitHubhttps://github.com//pull/210#issuecomment-16654308
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@@ -72,24 +72,24 @@ if(Test-Path($extensionsPath)) {

#main entry point
#Remove-LastInstallLog
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little scared about this...looks like a bad merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me investigate tomorrow and recertify. Good catch.

@ferventcoder
Copy link
Contributor

Other than that, I'm digging this PR.

all the bin files and chocolatey.cmd itself will exit with a
proper 0 or 1 exit code if an error is thrown during runtime
this function provides the ability to "bubble up" errors encountered
during chocolatey runs all the way back up to powershell or cmd

this was implemented in the command line switches evaluatation so
any chocolatey function where an error is thrown, an error message
and status code of 0 or 1 will be returned
provide the try/catch/throw bubble up functionality to the chocolatey
install process around nuget
if a single package version is queried at the cli in cmd or posh
then a 0 error status code is returned if the package is present on
the system or a 1 status code if 'not found'
@rismoney
Copy link
Contributor Author

alright - I believe this to be clean now - I based it off current HEAD, so you can plot it right on top :)
I think @mwrock and I have to write a lot of pester coverage on this project. we're taking in lots of changes, that are hard to validate through and through.

@ferventcoder
Copy link
Contributor

Yes, one thing we'll stop doing is accepting pull requests without automated tests. Probably soon.

@mwrock
Copy link
Contributor

mwrock commented Apr 26, 2013

I o not feel it is out of line to require submitters of pull requests to write tests. I know that is not necessarily as ubiquitous in powershell as it is in C# but this is one of the larger bits of powershell out there and it just wont be manageable or fun in any way to write tests on our own. It also helps to raise the bar of the community IMO. :)

@ferventcoder
Copy link
Contributor

Agreed with all Matt said here. :)

@gep13
Copy link
Member

gep13 commented Apr 26, 2013

For what it is worth, I agree with Matt as well. Contributing to this project was the first time I had ever used Pester, and I can honestly say that it was very simple to get up to speed with, and there are plenty of existing tests in the code base to use as a basis for new tests, so there really is no good reason , IMO, to not include additional unit tests.

Gary

@ferventcoder
Copy link
Contributor

This is in - a8ea10d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants