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

Fix latest flet-build-template version #3021

Merged
merged 1 commit into from
Apr 30, 2024
Merged
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
18 changes: 13 additions & 5 deletions sdk/python/packages/flet/src/flet/cli/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
from pathlib import Path
from typing import Optional

import flet.version
import yaml
from flet.cli.commands.base import BaseCommand
from flet_core.utils import random_string, slugify
from flet_runtime.utils import calculate_file_hash, copy_tree, is_windows
from packaging import version
from rich import print

import flet.version
from flet.cli.commands.base import BaseCommand
from flet.version import update_version

if is_windows():
from ctypes import windll

Expand Down Expand Up @@ -387,11 +389,17 @@ def handle(self, options: argparse.Namespace) -> None:
template_ref = options.template_ref
if not template_url:
template_url = DEFAULT_TEMPLATE_URL
if flet.version.version and not template_ref:
template_ref = version.Version(flet.version.version).base_version
if not template_ref:
if flet.version.version:
template_ref = version.Version(flet.version.version).base_version
else:
template_ref = update_version()

# create Flutter project from a template
print("Creating Flutter bootstrap project...", end="")
print(
f"Creating Flutter bootstrap project from {template_url} with ref {template_ref} ... ",
end="",
)
try:
cookiecutter(
template=template_url,
Expand Down