Skip to content

Commit

Permalink
Fix latest flet-build-template version (flet-dev#3021)
Browse files Browse the repository at this point in the history
  • Loading branch information
mse11 authored and 50Bytes-dev committed May 18, 2024
1 parent b5f4e61 commit 95b8a81
Showing 1 changed file with 13 additions and 5 deletions.
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

0 comments on commit 95b8a81

Please sign in to comment.