Skip to content

fix(clone): create missing destination folder on clone - #265

Open
sidimed-bahan wants to merge 1 commit into
mainfrom
cached-npmaudit-388
Open

fix(clone): create missing destination folder on clone#265
sidimed-bahan wants to merge 1 commit into
mainfrom
cached-npmaudit-388

Conversation

@sidimed-bahan

Copy link
Copy Markdown
Contributor

Problem

In the Clone GitHub repo dialog, typing a destination folder that doesn't exist yet (e.g. ~/Desktop/SoftwareSavants/code) failed the clone with Destination parent does not exist. The destination autocomplete also nagged with an inline Create "<name>" row and a "folder doesn't exist" warning.

Changes

  • github.rsclone_repo now create_dir_alls the destination parent when it's missing, instead of erroring.
  • ipc.rsclone_github_repo_and_add tilde-expands the typed path (expand_tilde) before cloning, so ~/... resolves to an absolute path (matching list_subdirs/create_subdir). Required — otherwise create_dir_all would create a literal ~ folder.
  • PathAutocomplete.tsx — new allowCreate prop (defaults true). The clone dialog passes allowCreate={false} to suppress the inline Create row and its warning; the path is created under the hood on Clone. BtsBuilderDialog keeps its inline create.

Tests

  • clone_creates_missing_destination_parent (Rust) — asserts the missing parent gets created.
  • does not show the Create row when allowCreate is false (frontend).

Net effect: type any destination path, click Clone, and it's created under the hood.

…oring

clone_repo now create_dir_all's the destination parent when it's absent,
and clone_github_repo_and_add tilde-expands the typed path first so
`~/Desktop/...` resolves to an absolute path before cloning.

The destination autocomplete drops its inline "Create <name>" row and the
"folder doesn't exist" warning (new allowCreate prop on PathAutocomplete,
defaults to true so BtsBuilder keeps inline create) — the path is created
under the hood when you click Clone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant