Skip to content

Commit

Permalink
fix: use path.join for generating java bin path
Browse files Browse the repository at this point in the history
  • Loading branch information
mok-liee committed Sep 5, 2024
1 parent aadd8ed commit 2dc0c8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/generator-cli/src/app/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import path from 'path';

const isWin = () => process.platform === 'win32';

/**
Expand All @@ -6,6 +8,6 @@ const isWin = () => process.platform === 'win32';
*/
export const javaCmd: string = process.env['JAVA_HOME']
? isWin()
? `"${process.env['JAVA_HOME']}/bin/java"`
: `${process.env['JAVA_HOME']}/bin/java`
? `"${path.join(process.env['JAVA_HOME'], 'bin', 'java')}"`
: `${path.join(process.env['JAVA_HOME'], 'bin', 'java')}`
: 'java';

0 comments on commit 2dc0c8e

Please sign in to comment.