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

merge PR for fox reload #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
30 changes: 20 additions & 10 deletions bin/kcl-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

/***
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Amazon Software License (the "License").
You may not use this file except in compliance with the License.
A copy of the License is located at

http://aws.amazon.com/asl/

or in the "license" file accompanying this file. This file is distributed
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing
permissions and limitations under the License.
***/

'use strict';
Expand Down Expand Up @@ -98,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 @@ -110,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 @@ -137,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];
var cmd = java + ' ' + args.join(' ');

console.log("==========================================================");
Expand Down Expand Up @@ -326,4 +336,4 @@ function errorExit(err) {
process.exit(1);
}

bootstrap();
bootstrap();