-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feature/add sync method to get key #28
base: v1.x/master
Are you sure you want to change the base?
Feature/add sync method to get key #28
Conversation
Signed-off-by: Jian Gao <[email protected]>
Signed-off-by: Jian Gao <[email protected]>
@@ -326,6 +326,10 @@ Plugin.prototype = { | |||
else { | |||
throw new Error (`No file name for data service`) | |||
} | |||
// Make the relative path clear. process.cwd() is zlux-example-server/bin/ | |||
if (!path.isAbsolute(fileLocation)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please provide some details as to why this is needed? What exactly did you do so that this makes a difference?
@@ -326,6 +326,10 @@ Plugin.prototype = { | |||
else { | |||
throw new Error (`No file name for data service`) | |||
} | |||
// Make the relative path clear. process.cwd() is zlux-example-server/bin/ | |||
if (!path.isAbsolute(fileLocation)) { | |||
fileLocation = path.join(process.cwd(),fileLocation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this even be right? Will a data service ever be found under just process.cwd(), which is, as you're saying, 'zlux-example-server/bin/' ?
@1000TurquoisePogs Sean, this actually raises a good question related to my npm package work. Let's say I have this plugin "locator": /my-sandbox/zlux-example-server/plugins/com.zowe.explorer.server.auth.json, that says: However, actually the file will be /my-sandbox/zlux-example-server/deploy/instance/ZLUX/plugins/com.zowe.explorer.server.auth.json. So, applying the ".." thing, we'll get /my-sandbox/zlux-example-server/deploy/instance/explorer-server-auth, which is wrong. So a relative pathname there should be relative to what exactly, that is known in the server in runtime? Also, we're resolving relative pathnames in the config similarly here: https://github.com/zowe/zlux-proxy-server/blob/master/js/index.js#L35 It still looks like a hack: locator authors assume /zlux-example-server/plugins to be the path relative to which everything is, and we use /zlux-example-server/bin instead, and it just happens to work because they all point to ../something anyway |
In my local project which includes Zowe, I need a function like getKeyFromPassword(), but I need it return a result instead of running a callback.
So I added a new function which works in sync way