-
Notifications
You must be signed in to change notification settings - Fork 10
/
rename.sh
executable file
·37 lines (32 loc) · 1.18 KB
/
rename.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Set the base directory. You can execute the script from the top-level directory
BASE_DIR=$(pwd)
# Rename function for sources
rename_sources() {
local dir="$1"
if [ -d "${dir}/src/main/java/io/vyne" ]; then
rm -rf "${dir}/src/main/java/com/orbitalhq/vyne"
# Ensure target directory structure exists
mkdir -p "${dir}/src/main/java/com/orbitalhq/"
# Move the vyne directory content into com/orbitalhq
mv "${dir}/src/main/java/io/vyne"/** "${dir}/src/main/java/com/orbitalhq"
fi
}
# Rename function for tests
rename_tests() {
local dir="$1"
if [ -d "${dir}/src/test/java/io/vyne" ]; then
rm -rf "${dir}/src/test/java/com/orbitalhq/vyne"
# Ensure target directory structure exists
mkdir -p "${dir}/src/test/java/com/orbitalhq/"
# Move the vyne directory content into com/orbitalhq
mv "${dir}/src/test/java/io/vyne"/** "${dir}/src/test/java/com/orbitalhq"
fi
}
# Iterate over all subdirectories
for dir in $(find "${BASE_DIR}" -type d -mindepth 1 -maxdepth 1); do
# Rename sources and tests directories
rename_sources "${dir}"
rename_tests "${dir}"
done
echo "Renaming completed!"