Skip to content

Commit

Permalink
refactor(ignite-openapi.sh): delete zombie comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Unique-Divine committed Oct 26, 2023
1 parent d8c57e8 commit 1d6b50a
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tools/ignite-openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,24 @@ ensure_path() {
current_dir=$(pwd)

# Get the directory of the script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# # Ensure the script is being run from the root of the repo
# if [ "$current_dir" != "${SCRIPT_DIR%/tools}" ]; then
# echo "Error: You must run this script from the repo root."
# return 1
# fi
# Get the root directory of the repo
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

local repo_root
repo_root="${SCRIPT_DIR%/tools}"
repo_root="${script_dir%/tools}"


# Check if we're in the root directory or tools directory of the repo
if [ "$current_dir" == "$repo_root" ]; then
# We're in the root, nothing to do
:
elif [ "$current_dir" == "$SCRIPT_DIR" ]; then
elif [ "$current_dir" == "$script_dir" ]; then
# We're in the tools directory, move one level up to the root
cd "$repo_root"
else
# We're neither in the root nor in the tools directory
log_error "You must run this script from the repo root or the tools directory."
log_debug "current_dir: $current_dir"
log_debug "SCRIPT_DIR: $SCRIPT_DIR"
log_debug "script_dir: $script_dir"
log_debug "repo_root: $repo_root"
exit 1
fi
Expand Down

0 comments on commit 1d6b50a

Please sign in to comment.