Skip to content

Commit 7ef9bb8

Browse files
PatriceJiangminggo
authored andcommitted
fix get environment (#19690)
1 parent 01a1063 commit 7ef9bb8

File tree

8 files changed

+49
-12
lines changed

8 files changed

+49
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,4 @@ temp/
182182

183183
# external libs zip
184184
*.zip
185+
**/simulator/
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/bash
22

3-
source ~/.bash_profile
4-
echo $COCOS_CONSOLE_ROOT
3+
if [ -f $HOME/.bashrc ]; then
4+
source $HOME/.bashrc
5+
fi
6+
7+
if [ -f $HOME/.bash_profile ]; then
8+
source $HOME/.bash_profile
9+
fi
10+
11+
echo $COCOS_CONSOLE_ROOT
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/bash
22

3-
source ~/.bash_profile
4-
echo $COCOS_CONSOLE_ROOT
3+
if [ -f $HOME/.bashrc ]; then
4+
source $HOME/.bashrc
5+
fi
6+
7+
if [ -f $HOME/.bash_profile ]; then
8+
source $HOME/.bash_profile
9+
fi
10+
11+
echo $COCOS_CONSOLE_ROOT
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/bash
22

3-
source ~/.bash_profile
4-
echo $COCOS_CONSOLE_ROOT
3+
if [ -f $HOME/.bashrc ]; then
4+
source $HOME/.bashrc
5+
fi
6+
7+
if [ -f $HOME/.bash_profile ]; then
8+
source $HOME/.bash_profile
9+
fi
10+
11+
echo $COCOS_CONSOLE_ROOT

tests/lua-empty-test/project/proj.android/app/build.gradle

+9-1
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,19 @@ def getCocosCommandPath() {
114114
return 'cocos.bat'
115115
}
116116
else {
117+
118+
def env_console_path = System.getenv("COCOS_CONSOLE_ROOT")
119+
120+
if (env_console_path != null && !env_console_path.trim().isEmpty()) {
121+
return new File(env_console_path.trim() + '/cocos').absolutePath
122+
}
123+
117124
// on unix like system, can not get environments variables easily
118125
// so run a shell script to get environment variable sets by cocos2d-x setup.py
119126
new ByteArrayOutputStream().withStream { os ->
120127
def result = exec {
121-
executable = project.file('get_environment.sh')
128+
executable = "/bin/bash"
129+
args = [ "-i", project.file('get_environment.sh')]
122130
standardOutput = os
123131
}
124132
ext.console_path = os.toString().trim()
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/bash
22

3-
source ~/.bash_profile
4-
echo $COCOS_CONSOLE_ROOT
3+
if [ -f $HOME/.bashrc ]; then
4+
source $HOME/.bashrc
5+
fi
6+
7+
if [ -f $HOME/.bash_profile ]; then
8+
source $HOME/.bash_profile
9+
fi
10+
11+
echo $COCOS_CONSOLE_ROOT
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Mar 14 17:47:54 CST 2017
1+
#Fri May 10 15:15:29 CST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

tools/cocos2d-console

Submodule cocos2d-console updated 1 file

0 commit comments

Comments
 (0)