Skip to content

Commit

Permalink
converted post-gen-proj to bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoZamora01 committed Jun 28, 2024
1 parent 5bd59c3 commit b8a8bfd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 38 deletions.

This file was deleted.

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

0 comments on commit b8a8bfd

Please sign in to comment.