Created
October 23, 2024 22:06
-
-
Save LimHyungTae/c8fdc465242dcc9b49c801cc6d9afe75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find all compile_commands.json files under ./build directory | |
find ./build -type f -name "compile_commands.json" | while read src_file; do | |
# Extract the package name from the file path | |
package_name=$(echo "$src_file" | sed -e 's|./build/\([^/]*\)/compile_commands.json|\1|') | |
# Define the destination path | |
dest_file="./src/${package_name}/compile_commands.json" | |
# Ensure the destination directory exists | |
mkdir -p "./src/${package_name}" | |
# Copy the file | |
echo "Copying $src_file to $dest_file" | |
cp "$src_file" "$dest_file" | |
done | |
echo "All available compile_commands.json files copied successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To copy
compile_commands.json
files for each package oncecompile_commands.json
does exist in./build/${PACKAGE_NAME}
.