Skip to content

Commit

Permalink
Merge branch 'master' into remove-nala-use-apt
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored Jun 25, 2024
2 parents b73cf39 + ab7ee19 commit e995cc9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
25 changes: 25 additions & 0 deletions scripts/_Team_Defines.bash
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,31 @@ alias ros2_control_setup-controller-package=$RosTeamWS_FRAMEWORK_SCRIPTS_PATH/ro
# setup auto-sourcing
alias setup-auto-sourcing=$RosTeamWS_FRAMEWORK_SCRIPTS_PATH/setup_auto_sourcing.bash

# VCS Aliases and helpers
function rtw-ws-import () {
# TODO: if not argument use WS default path for this after #169 is merged
vcs import --debug -w 1 --input "$*" $ROS_WS/src
}

# Temporary files cleaning
function rtw-find-and-remove-core-files () {
if [ -z "$1" ]; then
search_dir="${HOME}"
else
search_dir=$1
fi

find "${search_dir}" -type f -regex ".*core\.[0-9]+"

user_decision "Do you want to delete those files?" user_answer
if [[ " ${positive_answers[*]} " =~ " ${user_answer} " ]]; then
find "${search_dir}" -type f -regex ".*core\.[0-9]+" -delete
notify_user "Files ARE deleted!"
else
notify_user "Files NOT deleted!"
fi
}

# Team General aliases and functions
function generate_gif_from_video {

Expand Down
5 changes: 1 addition & 4 deletions scripts/setup_auto_sourcing.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ echo "Copying ${rtw_file} to your home folder."
if ! [ -f "$HOME/$rtw_file" ]; then
cp "${template_location}" ~/.
else
new_rtw_file_name="${rtw_file}.bkp-$(ls ${rtw_file_location}* | wc -l)"
echo ""
notify_user "${rtw_file} already exists. Moved it to ${new_rtw_file_name}."
mv "${rtw_file_location}" "$HOME/${new_rtw_file_name}" || { echo "Error: Could not create a copy of already existing ${rtw_file}. Please rename this file and run script again."; return 1; }
cp "${template_location}" ~/.
notify_user "${rtw_file} already exists."
fi

sed -i "s|source <PATH TO ros_team_workspace>/setup.bash|source $FRAMEWORK_BASE_PATH/setup.bash|g" "$rtw_file_location"
Expand Down

0 comments on commit e995cc9

Please sign in to comment.