Skip to content

Commit

Permalink
fix: path resolution to ensure git is initialized at workspace level (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev authored Mar 6, 2024
1 parent 9d4df31 commit 4fa1eaf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/algokit/cli/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ def init_command( # noqa: PLR0913

# allow skipping prompt if the template is the base template to avoid redundant
# 're-using existing directory' warning in fullstack template init
project_path = _get_project_path(
root_project_path = _get_project_path(
directory_name_option=directory_name, force=template == _get_blessed_templates()[TemplateKey.BASE]
)
logger.debug(f"project path = {project_path}")
directory_name = project_path.name
logger.debug(f"project path = {root_project_path}")
directory_name = root_project_path.name
# provide the directory name as an answer to the template, if not explicitly overridden by user
answers_dict.setdefault("project_name", directory_name)

Expand All @@ -319,8 +319,8 @@ def init_command( # noqa: PLR0913
else:
answers_dict.setdefault("python_path", "no_system_python_available")

project_path = _adjust_project_path_for_workspace(
template_source=template, project_path=project_path, use_workspace=use_workspace
project_path = _resolve_workspace_project_path(
template_source=template, project_path=root_project_path, use_workspace=use_workspace
)

logger.info(f"Starting template copy and render at {project_path}...")
Expand Down Expand Up @@ -352,7 +352,7 @@ def init_command( # noqa: PLR0913
_maybe_bootstrap(project_path, run_bootstrap=run_bootstrap, use_defaults=use_defaults, use_workspace=use_workspace)

_maybe_git_init(
project_path,
root_project_path,
use_git=use_git,
commit_message=f"Project initialised with AlgoKit CLI using template: {expanded_template_url}",
)
Expand Down Expand Up @@ -645,7 +645,7 @@ def git(*args: str, bad_exit_warn_message: str) -> bool:
logger.info("🎉 Performed initial git commit successfully! 🎉")


def _adjust_project_path_for_workspace(
def _resolve_workspace_project_path(
*, template_source: TemplateSource, project_path: Path, use_workspace: bool = True
) -> Path:
blessed_template = _get_blessed_templates()
Expand Down

1 comment on commit 4fa1eaf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py440%1–7
src/algokit/cli
   completions.py108298%83, 98
   deploy.py72790%44, 46, 92–94, 158, 182
   dispenser.py121199%77
   doctor.py48394%142–144
   explore.py501276%34–39, 41–46
   generate.py67396%74–75, 140
   goal.py44198%71
   init.py2752591%384–385, 440, 443–445, 456, 460, 516, 542, 571, 604, 613–615, 618–623, 636, 653, 665–666, 683–686
   localnet.py1191587%74–78, 111, 123, 138–148, 161, 206, 227–228
   task.py34391%25–28
src/algokit/cli/common
   utils.py26292%120, 123
src/algokit/cli/tasks
   analyze.py81199%81
   assets.py821384%65–66, 72, 74–75, 105, 119, 125–126, 132, 134, 136–137
   ipfs.py51884%52, 80, 92, 94–95, 105–107
   mint.py66494%48, 70, 91, 250
   send_transaction.py651085%52–53, 57, 89, 158, 170–174
   sign_transaction.py59886%21, 28–30, 71–72, 109, 123
   transfer.py39392%26, 90, 117
   utils.py994555%26–34, 40–43, 75–76, 100–101, 125–133, 152–162, 209, 258–259, 279–290, 297–299
   vanity_address.py561082%41, 45–48, 112, 114, 121–123
   wallet.py79495%21, 66, 136, 162
src/algokit/core
   bootstrap.py1191191%42, 106–107, 129, 156, 185–190
   conf.py661577%12, 24, 28, 36, 38, 72–74, 92–100
   deploy.py691184%61–64, 73–75, 79, 84, 91–93
   dispenser.py2022687%91, 123–124, 141–149, 191–192, 198–200, 218–219, 259–260, 318, 332–334, 345–346, 356, 369, 384
   doctor.py65789%67–69, 92–94, 134
   generate.py48394%44, 81, 99
   goal.py60395%30–31, 41
   init.py39685%59, 63–68, 76
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py2181892%62, 73–75, 96, 142–149, 160, 457, 473, 498, 506
   typed_client_generation.py80594%55–57, 70, 75
   utils.py1063171%44–45, 49–68, 129, 132, 138–152
   version_prompt.py921485%37–38, 68, 87–90, 108, 118–125, 148
src/algokit/core/tasks
   analyze.py93397%105–112, 187
   ipfs.py63789%58–64, 140, 144, 146, 152
   nfd.py491373%25, 31, 34–41, 70–72, 99–101
   vanity_address.py903462%49–50, 54, 59–75, 92–108, 128–131
   wallet.py71593%37, 129, 155–157
src/algokit/core/tasks/mint
   mint.py781087%123–133, 187
   models.py901188%50, 52, 57, 71–74, 85–88
TOTAL363143288% 

Tests Skipped Failures Errors Time
411 0 💤 0 ❌ 0 🔥 24.145s ⏱️

Please sign in to comment.