added sdk.dir to gradle.properties
This commit is contained in:
33
dist/init_rc.sh
vendored
33
dist/init_rc.sh
vendored
@@ -2,24 +2,31 @@
|
|||||||
|
|
||||||
# detect if either .bashrc or .zshrc is present
|
# detect if either .bashrc or .zshrc is present
|
||||||
|
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
|
||||||
SHELL_RC="$HOME/.bashrc"
|
# check if user is root and change user to builder
|
||||||
elif [ -f "$HOME/.zshrc" ]; then
|
TEMP_USER="builder"
|
||||||
SHELL_RC="$HOME/.zshrc"
|
|
||||||
|
if [ "$EUID" -eq 0 ]; then
|
||||||
|
BUILD_USER="$TEMP_USER"
|
||||||
else
|
else
|
||||||
touch "$HOME/.bashrc"
|
BUILD_USER="$USER"
|
||||||
SHELL_RC="$HOME/.bashrc"
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f "/home/$BUILD_USER/.bashrc" ]; then
|
||||||
|
SHELL_RC="/home/$BUILD_USER/.bashrc"
|
||||||
|
elif [ -f "/home/$BUILD_USER/.zshrc" ]; then
|
||||||
|
SHELL_RC="/home/$BUILD_USER/.zshrc"
|
||||||
|
else
|
||||||
|
touch "/home/$BUILD_USER/.bashrc"
|
||||||
|
SHELL_RC="/home/$BUILD_USER/.bashrc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using shell rc file: $SHELL_RC"
|
echo "Using shell rc file: $SHELL_RC"
|
||||||
|
|
||||||
# Check if content already exists in the shell rc file and if not, append it
|
# Check if content already exists in the shell rc file and if not, append it
|
||||||
|
|
||||||
if ! grep -q "export PATH=\$PATH:\$HOME/.local/bin" "$SHELL_RC"; then
|
cat /home/"$BUILD_USER"/"$SHELL_RC" | if ! grep -q "ANDROID_HOME" ; then
|
||||||
echo "Adding .local/bin to PATH in $SHELL_RC"
|
cat dist/.baserc >> /home/"$BUILD_USER"/"$SHELL_RC" fi
|
||||||
echo 'export PATH=$PATH:$HOME/.local/bin' >> "$SHELL_RC"
|
|
||||||
else
|
|
||||||
echo ".local/bin is already in PATH in $SHELL_RC"
|
|
||||||
fi
|
|
||||||
|
|
||||||
source "$SHELL_RC"
|
source /home/"$BUILD_USER"/"$SHELL_RC"
|
||||||
|
|||||||
Reference in New Issue
Block a user