Skip to content

Instantly share code, notes, and snippets.

@Tutorgaming
Last active January 28, 2024 18:40
Show Gist options
  • Save Tutorgaming/7f2fc268cd9cb470d0cca39c44195850 to your computer and use it in GitHub Desktop.
Save Tutorgaming/7f2fc268cd9cb470d0cca39c44195850 to your computer and use it in GitHub Desktop.
colcon_build with src folder only

Colcon_Build :)

This is the simple function to avoid running colcon build in the directory which is not contain folder named 'src/' (which might infer the place which is not the colcon workspace)

i know that removing build/ install/ logs/ is so painful !

# Append this to your ".bashrc"
function colcon_build() {
if [ -d "src" ]; then
command colcon build "$@"
else
echo "Error: 'src/' directory not found in the current directory."
fi
}
alias colcon_build=colcon_build
# And use colcon_build 4 life :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment