Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18162] Autodetect proxy configuration within ti setup #184

Merged
merged 4 commits into from Feb 12, 2015

Conversation

skypanther
Copy link
Contributor

…Line Interface, CLI version 3.6.0-dev, Titanium SDK version 3.6.0

Copyright (c) 2012-2014, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

Enter ctrl-c at any time to quit.

──────────────────────┤ Main Menu ├───────────────────────

   1)  �[36m�[1m�[4mq�[24m�[22m�[39muick    Quick Setup
   2)  chec�[36m�[1m�[4mk�[24m�[22m�[39m    Check Environment
   3)  �[36m�[1m�[4mu�[24m�[22m�[39mser     User Information
   4)  a�[36m�[1m�[4mp�[24m�[22m�[39mp      New App Defaults
   5)  �[36m�[1m�[4mn�[24m�[22m�[39metwork  Network Settings
   6)  �[36m�[1m�[4mc�[24m�[22m�[39mli      Titanium CLI Settings
   7)  �[36m�[1m�[4ms�[24m�[22m�[39mdk      Titanium SDK Settings
   8)  �[36m�[1m�[4mi�[24m�[22m�[39mos      iOS Settings
   9)  �[36m�[1m�[4ma�[24m�[22m�[39mndroid  Android Settings
  10)  e�[36m�[1m�[4mx�[24m�[22m�[39mit     Exit
Where do you want to go?
defaultProxy = this._config.get('cli.httpProxyServer');
} else if(proxy.length > 0) {
var pI = 0, pL = proxy.length;
for(; pI < pL; pI++) {

Choose a reason for hiding this comment

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

can be just :

for(pI = 0; pI < proxy.length; pI++) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

except that then pI and pL would be global variables. I admit the form is a bit unusual but it follows the pattern of other code in the project.

Copy link
Contributor

Choose a reason for hiding this comment

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

Typically I would just do:

for (var i = 0, len = proxy.length; i++) {

pI and pL are horrible names.

If you're feeling functional, you could do:

proxy.some(function (p) {
    if (p && p.valid) {
        defaultProxy = p.fullAddress;
        console.log(defaultProxy);
        return true;
    }
});

@sujmishra
Copy link

merging..

sujmishra pushed a commit that referenced this pull request Feb 12, 2015
[TIMOB-18162] Autodetect proxy configuration within ti setup
@sujmishra sujmishra merged commit 75385da into tidev:master Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants