Skip to content

Commit 1d71d5e

Browse files
#272 fix: improvement of the environment variable extracting
1 parent dc70c9c commit 1d71d5e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/io/appium/java_client/service/local/AppiumServiceBuilder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public AppiumServiceBuilder() {
138138
protected File findDefaultExecutable() {
139139

140140
String nodeJSExec = System.getProperty(NODE_JS_EXECUTABLE_PROPERTY);
141+
if (StringUtils.isBlank(nodeJSExec)) {
142+
nodeJSExec = System.getenv(NODE_JS_EXECUTABLE_PROPERTY);
143+
}
141144
if (!StringUtils.isBlank(nodeJSExec)) {
142145
File result = new File(nodeJSExec);
143146
if (result.exists()) {
@@ -231,7 +234,10 @@ void checkAppiumJS(){
231234
}
232235

233236
String appiumJS = System.getProperty(APPIUM_NODE_PROPERTY);
234-
if (appiumJS !=null){
237+
if (StringUtils.isBlank(appiumJS)) {
238+
appiumJS = System.getenv(APPIUM_NODE_PROPERTY);
239+
}
240+
if (!StringUtils.isBlank(appiumJS)){
235241
File node = new File(appiumJS);
236242
validateNodeStructure(node);
237243
this.appiumJS = node;

0 commit comments

Comments
 (0)