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

Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=520487 #134

Merged
merged 1 commit into from Aug 3, 2017
Merged

Conversation

bkuschel
Copy link
Contributor

@bkuschel bkuschel commented Aug 3, 2017

Signed-off-by: Boris Kuschel kuschel@ca.ibm.com

@soulbeing could you review and merge this thx.

Signed-off-by: Boris Kuschel <kuschel@ca.ibm.com>
return fs.readFileSync(passwordFile,'utf8');
var lines = fs.readFileSync(passwordFile,'utf8')
.split('\n').filter(Boolean);
return lines.length>0?lines[0]:null;
Copy link
Contributor

@soulbeing soulbeing Aug 3, 2017

Choose a reason for hiding this comment

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

My comments are:

  1. Is it by convention only the first line of a passwordFile treated as the password? rather then the whole content(without carriage in between), so I don't know if this is the right way by design.
  2. Why filter(Boolean), I can't see what this code is doing. Array.filter expects a callback, but I don't know what a Boolean Constructor is doing here.
  3. Since I never used this feature before, and I don't know who is using it now, so basically if Silenio is fine with using only the first line, I'm totally OK with it as well.

Copy link
Contributor Author

@bkuschel bkuschel Aug 3, 2017

Choose a reason for hiding this comment

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

  1. Yes. There should only be one line. Problem is that there seems to be a bug in the readFileSync function that appends a carriage return. I think it's safe to ignore any garbage after a carriage return regardless
  2. filter Boolean takes garbage out of the array.
  3. I am using it in the orion build for kubernetes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@soulbeing soulbeing merged commit d0d5ec4 into eclipse:master Aug 3, 2017
soulbeing pushed a commit that referenced this pull request Aug 8, 2017
…134)

Signed-off-by: Boris Kuschel <kuschel@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants