Skip to content

Commit

Permalink
Add support for 'win32' platform (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawellabudafitit authored and micah-jaffe committed Oct 23, 2019
1 parent 4790a36 commit fe7934a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/kcl-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,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 +114,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 +141,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

0 comments on commit fe7934a

Please sign in to comment.