Skip to content

Commit 2ae1352

Browse files
authored
[build_ros2.sh] Create actual tmp dir and removal script.
1 parent 9cae94e commit 2ae1352

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.devel/build_ros2.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,19 @@ fi
8585

8686

8787
####################################################################
88-
# Create tmp folder
88+
# Create and cd tmp folder
8989
####################################################################
9090

91-
rm -rf tmp_ros2
92-
mkdir tmp_ros2
93-
cd tmp_ros2
91+
TMP_DIR=`mktemp -d`
92+
echo "Temporary dir $TMP_DIR will be used for this build."
93+
cd $TMP_DIR
94+
95+
# Create temporary folder removal script. We do not attempt to do that
96+
# here because a wrong rm can be catastrophic. Run at your own risk.
97+
echo "
98+
#!/bin/bash
99+
rm -r $TMP_DIR
100+
" >> "~/sas_ws/src/sas/.devel/remove_tmp_folder.sh"
94101

95102
####################################################################
96103
# Clone all packages

0 commit comments

Comments
 (0)