Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write env-vars to ~/.profile instead of ~/.bashrc #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ GITHUB_PREFIX="https://github.com/raspberrypi/"
GITHUB_SUFFIX=".git"
SDK_BRANCH="master"

# Add blank line to ~/.profile before adding our path-vars
echo "" >> ~/.profile

for REPO in sdk examples extras playground
do
DEST="$OUTDIR/pico-$REPO"
Expand All @@ -68,18 +71,16 @@ do
git submodule update --init
cd $OUTDIR

# Define PICO_SDK_PATH in ~/.bashrc
# Define PICO_XXXX_PATH in ~/.profile
VARNAME="PICO_${REPO^^}_PATH"
echo "Adding $VARNAME to ~/.bashrc"
echo "export $VARNAME=$DEST" >> ~/.bashrc
echo "Adding $VARNAME to ~/.profile"
echo "export $VARNAME=$DEST" >> ~/.profile
export ${VARNAME}=$DEST
fi
done

cd $OUTDIR

# Pick up new variables we just defined
source ~/.bashrc

# Build a couple of examples
cd "$OUTDIR/pico-examples"
Expand Down