Repo: command not found in automatic bash script to create cyanogenmod

I run linux mint 17.2, I have it installed repo, and the path to it is repoadded to mine .bashrc. I previously initiated mine repo.

I followed the instructions for Downloading Android Files and How to Create CyanogenMod Pages .

Problem : I wrote a bash script to automate a number of commands that I would like to use to start the build. My script is in simple form:

#!/bin/bash
cd ~/Android/Cyanogenmod/cm12_1/android/system
source build/envsetup.sh
repo sync --force-sync -j8
exec $SHELL

When I run this, it reports:

/home/username/Desktop/Cyanogenmod_cm12_1_Grouper_Build : line 4 repo: command not found

If I copy and paste each line into a new terminal instance (or just by running a script from #!/bin/bash exec $SHELLto open the terminal), it works fine.

: sleep 10 repo sync --force-sync -j8, . PATH , repo sync --force-sync -j8. :

#!/bin/bash
mkdir -p ~/Android/Cyanogenmod/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/Android/Cyanogenmod/bin/repo
chmod a+x ~/Android/Cyanogenmod/bin/repo
cd ~/Android/Cyanogenmod/cm12_1/android/system/
source build/envsetup.sh
PATH=~/Android/Cyanogenmod/bin/repo:$PATH
repo sync --force-sync -j8
exec $SHELL

, , this this.

, !

+4
1

, 2 . -, script, PATH=~/Android/Cyanogenmod/bin/repo:$PATH PATH=~/Android/Cyanogenmod/bin:$PATH.

- PATH ( repo) .bashrc. export PATH=$PATH:$HOME/Android/Cyanogenmod/bin .profile, /.

0

Source: https://habr.com/ru/post/1615537/


All Articles