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

Add support for 'win32' platform #67

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions bin/kcl-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ function bootstrap() {
});
}

function createJavaHomeExecutablePath() {
return path.join(process.env.JAVA_HOME, 'bin', process.platform !== 'win32' ? 'java' : 'java.exe');
}

function parseArguments() {
program
.option('-p, --properties [properties file]', 'properties file with multi-language daemon options')
Expand All @@ -120,7 +124,7 @@ function parseArguments() {
var args = {
'properties': program.properties,
'logConfiguration': program.logConfiguration ? program.logConfiguration: null,
'java': (program.java ? program.java : (process.env.JAVA_HOME ? path.join(process.env.JAVA_HOME, 'bin', 'java') : null)),
'java': (program.java ? program.java : (process.env.JAVA_HOME ? createJavaHomeExecutablePath() : null)),
'jarPath': (program.jarPath ? program.jarPath : DEFAULT_JAR_PATH),
'execute': program.execute
};
Expand All @@ -147,14 +151,10 @@ function parseArguments() {
}

function startKinesisClientLibraryApplication(options) {
var classpath = '-cp ' + getClasspath(options).join(getPathDelimiter());
var classpath = getClasspath(options).join(getPathDelimiter());
var java = options.java;
var propertiesFile = '--properties-file ' + options.properties;
var logConfiguration = '';
if (options.logConfiguration) {
logConfiguration = '--log-configuration ' + options.logConfiguration;
}
var args = [classpath, MULTI_LANG_DAEMON_CLASS, propertiesFile, logConfiguration];
var logConfiguration = options.logConfiguration ? ['--log-configuration', options.logConfiguration] : [];
var args = ['-cp', classpath, MULTI_LANG_DAEMON_CLASS, '--properties-file', options.properties, ...logConfiguration];
Copy link

Choose a reason for hiding this comment

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

this line seems to be necessary on mac as well

Choose a reason for hiding this comment

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

this line seems to be necessary on mac as well

Confirmed

Choose a reason for hiding this comment

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

And linux too

var cmd = java + ' ' + args.join(' ');

console.log("==========================================================");
Expand Down