Skip to content

Commit

Permalink
Read app name from fly.toml instead of hardcoded app name
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Nov 22, 2024
1 parent d967bc5 commit cedb820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/scripts/register_to_fly_io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
echo -e "\033[0;32mAlready logged into fly.io\033[0m"
fi

export FLY_APP_NAME={{ cookiecutter.project_slug.replace("_", "-") }}
export FLY_APP_NAME=$(grep "^app = " fly.toml | awk -F"'" '{print $2}')

echo -e "\033[0;32mRegistering app name in fly.io\033[0m"
if flyctl apps create $FLY_APP_NAME; then
Expand All @@ -27,6 +27,6 @@ if flyctl apps create $FLY_APP_NAME; then
cat registered_app_domain.txt
else
echo -e "\033[1;31mError: App name is not available.\033[0m"
echo -e "\033[1;31mPlease change the app name in fly.toml and scripts/register_to_fly_io.sh and run this script again.\033[0m"
echo -e "\033[1;31mPlease change the app name in fly.toml and run this script again.\033[0m"
exit 1
fi

0 comments on commit cedb820

Please sign in to comment.