Fix localhive CLI publish copy#17670
Conversation
Copy publish directory contents recursively so localized resource folders and other subdirectories are installed with the Aspire CLI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17670Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17670" |
There was a problem hiding this comment.
Pull request overview
This PR fixes localhive.sh CLI installation when the dotnet publish output contains subdirectories (e.g., culture/resource folders). It replaces a glob-based cp that fails on directories with a recursive contents copy that works across BSD/macOS and GNU/Linux cp.
Changes:
- Switch CLI publish output copy from
cp "$dir"/*tocp -R "$dir"/.to correctly copy both files and subdirectories. - Update the in-script comment to reflect directory-copy behavior.
|
❓ CLI E2E Tests unknown — 108 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26651125653 |
…lhive-recursive-copy
…acOS/Linux Documents the 'Failed to copy CLI files' error that occurs when using localhive.sh with a publish output containing culture-specific subdirectories (e.g., fr/, de/). The fix is to use cp -Rf with the /. suffix instead of a glob. Relates to microsoft/aspire#17670 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pull request created: #1128
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1128 targeting Added a "Building from source" troubleshooting section to Note: The Note This draft PR needs human review before merging. |
Description
Fixes
localhive.shCLI installation when the publish output contains subdirectories, such as culture-specific resource folders.The failing path was using:
That wildcard expands both files and directories. On macOS/BSD
cp, a publish resource directory such asfr/causes an error likecp: .../fr is a directory (not copied); on Linux/GNUcp, the equivalent iscp: -r not specified; omitting directory '...'. Because the script runs withset -eand checks thecpresult, it then aborted with the localhive error path:Failed to copy CLI files from $CLI_PUBLISH_DIR to $CLI_BIN_DIR.This changes the install copy to recursively copy the publish directory contents:
Using
/.preserves the intended contents-copy behavior while allowing both files and directories to be installed.Validation:
Also manually validated the copy command against a temporary publish directory containing a nested culture/resource folder.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?