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

Fix spaces in parent folder name #18

Open
wants to merge 3 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
30 changes: 15 additions & 15 deletions pico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else
fi

# Number of cores when running make
JNUM=4
JNUM=$(cat /proc/cpuinfo | grep processor | wc -l)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this change in a separate PR, as it's unrelated the the spaces-in-path issue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh.. Apologies I missed that. Will do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you removed this, but then added it back again??
You might find things easier to manage if you do them on separate branches, rather than doing everything on protik09:master 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @protik09 again. Can you please update this PR to remove this change?


# Where will the output go?
OUTDIR="$(pwd)/pico"
Expand Down Expand Up @@ -44,8 +44,8 @@ sudo apt install -y $DEPS

echo "Creating $OUTDIR"
# Create pico directory to put everything in
mkdir -p $OUTDIR
cd $OUTDIR
mkdir -p "$OUTDIR"
cd "$OUTDIR"

# Clone sw repos
GITHUB_PREFIX="https://github.com/raspberrypi/"
Expand All @@ -56,27 +56,27 @@ for REPO in sdk examples extras playground
do
DEST="$OUTDIR/pico-$REPO"

if [ -d $DEST ]; then
if [ -d "$DEST" ]; then
echo "$DEST already exists so skipping"
else
REPO_URL="${GITHUB_PREFIX}pico-${REPO}${GITHUB_SUFFIX}"
echo "Cloning $REPO_URL"
git clone -b $SDK_BRANCH $REPO_URL

# Any submodules
cd $DEST
cd "$DEST"
git submodule update --init
cd $OUTDIR
cd "$OUTDIR"

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

cd $OUTDIR
cd "$OUTDIR"

# Pick up new variables we just defined
source ~/.bashrc
Expand All @@ -90,12 +90,12 @@ cmake ../ -DCMAKE_BUILD_TYPE=Debug
for e in blink hello_world
do
echo "Building $e"
cd $e
cd "$e"
Copy link
Contributor

@lurch lurch Mar 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically not needed here, as neither blink nor hello_world contain spaces 😉 (but I guess it doesn't hurt)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be inclined to keep the quotes everywhere they may be needed, to make it future proof/consistent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that's why I said "(but I guess it doesn't hurt)"

make -j$JNUM
cd ..
done

cd $OUTDIR
cd "$OUTDIR"

# Picoprobe and picotool
for REPO in picoprobe picotool
Expand All @@ -105,7 +105,7 @@ do
git clone $REPO_URL

# Build both
cd $DEST
cd "$DEST"
mkdir build
cd build
cmake ../
Expand All @@ -116,7 +116,7 @@ do
sudo cp picotool /usr/local/bin/
fi

cd $OUTDIR
cd "$OUTDIR"
done

if [ -d openocd ]; then
Expand All @@ -129,7 +129,7 @@ if [[ "$SKIP_OPENOCD" == 1 ]]; then
else
# Build OpenOCD
echo "Building OpenOCD"
cd $OUTDIR
cd "$OUTDIR"
# Should we include picoprobe support (which is a Pico acting as a debugger for another Pico)
INCLUDE_PICOPROBE=1
OPENOCD_BRANCH="rp2040"
Expand All @@ -147,7 +147,7 @@ else
sudo make install
fi

cd $OUTDIR
cd "$OUTDIR"

# Liam needed to install these to get it working
EXTRA_VSCODE_DEPS="libx11-xcb1 libxcb-dri3-0 libdrm2 libgbm1 libegl-mesa0"
Expand Down