-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: knqyf263 <[email protected]>
- Loading branch information
Showing
6 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
output_file=$1 | ||
|
||
# Remove the output file if it exists | ||
if [ -f "$output_file" ]; then | ||
rm "$output_file" | ||
fi | ||
|
||
# Process all YAML files under the plugins directory | ||
for file in plugins/*/*.yaml; do | ||
# Get the directory name as the namespace | ||
namespace=$(basename "$(dirname "$file")") | ||
|
||
# Read the content of the YAML file, add the namespace, and append to the output file | ||
while IFS= read -r line; do | ||
if [[ $line == *"- name:"* ]]; then | ||
echo "$line" >> "$output_file" | ||
echo " namespace: $namespace" >> "$output_file" | ||
else | ||
echo "$line" >> "$output_file" | ||
fi | ||
done < "$file" | ||
|
||
# Add a separator line between files | ||
echo "" >> "$output_file" | ||
done |
File renamed without changes.
File renamed without changes.
Empty file.
This file contains 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