-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converted post-gen-proj to bash script
- Loading branch information
1 parent
5bd59c3
commit b8a8bfd
Showing
2 changed files
with
33 additions
and
38 deletions.
There are no files selected for viewing
38 changes: 0 additions & 38 deletions
38
tier2/{{cookiecutter.project_slug}}/repometrics/hooks/post_gen_project.py
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
tier2/{{cookiecutter.project_slug}}/repometrics/hooks/post_gen_project.sh
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,33 @@ | ||
#!/bin/bash | ||
|
||
# Change to the parent directory | ||
cd .. | ||
|
||
# Define the repometrics directory to remove | ||
dir_name="repometrics" | ||
|
||
# Check if repometrics directory exists and remove it | ||
if [ -d "$dir_name" ]; then | ||
rm -rf "$dir_name" | ||
fi | ||
|
||
project_type="{{cookiecutter.project_type}}" | ||
sub_project_dir="${project_type}" | ||
repometrics_file="code.json" | ||
parent_dir="./" | ||
|
||
if [ -f "${sub_project_dir}/${repometrics_file}" ]; then | ||
# Move code.json file to parent directory | ||
mv "${sub_project_dir}/${repometrics_file}" "${parent_dir}" | ||
|
||
# Check if the move was successful | ||
if [ $? -eq 0 ]; then | ||
# Remove the source directory | ||
rm -rf "${sub_project_dir}" | ||
|
||
# Check if the deletion was successful | ||
if [ $? -eq 0 ]; then | ||
echo "Successfully generated code.json file." | ||
fi | ||
fi | ||
fi |