Skip to content

Commit

Permalink
add migration script(TlmCmd -> tlm_cmd)
Browse files Browse the repository at this point in the history
  • Loading branch information
sksat committed Aug 30, 2023
1 parent 07f810c commit 0da429b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions script/migration/v4-rename-tlmcmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
# Script -> script

## c2a-core ref
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/TlmCmd/Ccsds#src_core/tlm_cmd/ccsds#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\TlmCmd\\\Ccsds#src_core\\\tlm_cmd\\\ccsds#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/TlmCmd#src_core/tlm_cmd#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\TlmCmd#src_core\\\tlm_cmd#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/TlmCmd#\${C2A_CORE_DIR}/applications#g"

# C2A user code
mv src/src_user/TlmCmd src/src_user/tlm_cmd

mv src/src_user/tlm_cmd/Ccsds src/src_user/tlm_cmd/ccsds
mv src/src_user/tlm_cmd/NormalBlockCommandDefinition src/src_user/tlm_cmd/normal_block_command_definition

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#TlmCmd/Ccsds#tlm_cmd/ccsds#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#TlmCmd\\\Ccsds#tlm_cmd\\\ccsds#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#/TlmCmd#/tlm_cmd#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\\\TlmCmd#\\\tlm_cmd#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#TlmCmd/#tlm_cmd/#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#TlmCmd\\\#tlm_cmd\\\#g"

# CMake
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Ccsds/#ccsds/#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#NormalBlockCommandDefinition/#normal_block_command_definition/#g"

# Settings
mv src/src_user/Settings/TlmCmd src/src_user/Settings/tlm_cmd

mv src/src_user/Settings/tlm_cmd/Ccsds src/src_user/Settings/tlm_cmd/ccsds
mv src/src_user/Settings/tlm_cmd/NormalBlockCommandDefinition src/src_user/Settings/tlm_cmd/normal_block_command_definition
mv src/src_user/Settings/tlm_cmd/DataBase src/src_user/Settings/tlm_cmd/data_base

# Test
mv src/src_user/Test/test/src_core/TlmCmd src/src_user/Test/test/src_core/tlm_cmd

mv src/src_user/Test/test/src_user/TlmCmd src/src_user/Test/test/src_user/tlm_cmd

# Script
find src/src_user/script -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#TlmCmd#tlm_cmd#g"

0 comments on commit 0da429b

Please sign in to comment.