提交 1d07fe66 编写于 作者: gengqx's avatar gengqx 提交者: Jiangtao Hu

scritps: add a script to write log to a file about the env when record the bag

上级 0add1f33
......@@ -392,6 +392,19 @@ function run_customized_path() {
esac
}
#write log to a file about the env when record a bag.
function record_bag_env_log() {
TASK_ID=$(date +%Y-%m-%d-%H-%M)
commit=$(git log -1)
echo -e "Date:$(date)\n" >> Bag_Env_$TASK_ID.log
git branch | awk '/\*/ { print "current branch: " $2; }' >> Bag_Env_$TASK_ID.log
echo -e "\nNewest commit:\n$commit" >> Bag_Env_$TASK_ID.log
echo -e "\ngit diff:" >> Bag_Env_$TASK_ID.log
git diff >> Bag_Env_$TASK_ID.log
echo -e "\n\n\n\n" >> Bag_Env_$TASK_ID.log
echo -e "git diff --staged:" >> Bag_Env_$TASK_ID.log
git diff --staged >> Bag_Env_$TASK_ID.log
}
# run command_name module_name
function run() {
local module=$1
......
......@@ -26,6 +26,7 @@ function start() {
cd "${TASK_DIR}"
# Start recording.
record_bag_env_log
LOG="/tmp/apollo_record.out"
NUM_PROCESSES="$(pgrep -c -f "rosbag record")"
if [ "${NUM_PROCESSES}" -eq 0 ]; then
......
......@@ -26,6 +26,7 @@ function start() {
cd "${TASK_DIR}"
# Start recording.
record_bag_env_log
LOG="/tmp/apollo_record.out"
NUM_PROCESSES="$(pgrep -c -f "rosbag record")"
if [ "${NUM_PROCESSES}" -eq 0 ]; then
......
......@@ -26,6 +26,7 @@ function start() {
cd "${TASK_DIR}"
# Start recording.
record_bag_env_log
LOG="/tmp/apollo_record.out"
NUM_PROCESSES="$(pgrep -c -f "rosbag record")"
if [ "${NUM_PROCESSES}" -eq 0 ]; then
......
......@@ -26,6 +26,7 @@ function start() {
cd "${TASK_DIR}"
# Start recording.
record_bag_env_log
LOG="/tmp/apollo_record.out"
NUM_PROCESSES="$(pgrep -c -f "rosbag record")"
if [ "${NUM_PROCESSES}" -eq 0 ]; then
......
......@@ -26,6 +26,7 @@ function start() {
cd "${TASK_DIR}"
# Start recording.
record_bag_env_log
LOG="/tmp/apollo_record.out"
NUM_PROCESSES="$(pgrep -c -f "rosbag record")"
if [ "${NUM_PROCESSES}" -eq 0 ]; then
......
......@@ -26,6 +26,7 @@ function start() {
cd "${TASK_DIR}"
# Start recording.
record_bag_env_log
LOG="/tmp/apollo_record.out"
NUM_PROCESSES="$(pgrep -c -f "rosbag record")"
if [ "${NUM_PROCESSES}" -eq 0 ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册