Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read app name from fly.toml and ignore yaml in pre-commit #51

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ repos:
exclude: |
(?x)^(
^{{cookiecutter.project_slug}}/.devcontainer/docker-compose.yml|
^{{cookiecutter.project_slug}}/.github/workflows/test.yml
^{{cookiecutter.project_slug}}/.github/workflows/test.yml|
^{{cookiecutter.project_slug}}/.github/workflows/deploy_to_fly_io.yml
)
- id: check-added-large-files

Expand Down
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