Skip to content

Commit

Permalink
Add comment explaining why the environment variable should be normalized
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Baars committed Jun 17, 2020
1 parent 81bfa64 commit 655cb05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export async function getJava(
}

let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch;
// For portability reasons environment variables should only consist of
// uppercase letters, digits, and the underscore. Therefore we convert
// the extendedJavaHome variable to upper case and replace '.' symbols and
// any other non-alphanumeric characters with an underscore.
extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_');
core.exportVariable('JAVA_HOME', toolPath);
core.exportVariable(extendedJavaHome, toolPath);
Expand Down

0 comments on commit 655cb05

Please sign in to comment.