rtrouton / rtrouton_scripts

Scripts to share
MIT License
1.3k stars 491 forks source link

Down to one if statement #3

Closed rmanly closed 12 years ago

rmanly commented 12 years ago

By checking for both conditions using AND we can simplify so that 7 & 8 pass the test.

Checking for 9 and that extra code made me lol but it is ultimately clutter.

The output of spctl at this time is so simple we only need to get the second field. This is also clear enough that we don't need to assign $result with synonymous words

rtrouton commented 12 years ago

Ryan,

I appreciate the work to improve my script, but I deliberately split out by OS. The issue is that spctl in 10.7 and 10.8 are returning the same output right now, but that's not guaranteed to be the case in the future.

It's not likely that 10.7.5's spctl output is going to change, so I wanted to make sure that the 10.8 and 10.9 sections can be independently handled while leaving the 10.7 section alone. Once we get closer to 10.9, I'll likely re-factor to include your changes if it looks like 10.8's spctl output won't be changing.

Thanks, Rich

rmanly commented 12 years ago

;)

Sounds good. I love how you put everything out there. I get a lot of ideas from looking at your stuff.

Like, "Oh yea...I could be automate that."

Keep 'em coming. ~me