Skip to content

Conversation

@dobrac
Copy link
Contributor

@dobrac dobrac commented Nov 4, 2025

Copy command now resolves relative target paths from the specified workdir, or falls back to the owner's home directory.

The issue was that as the copy was done always under root, the home directory was always "/root" instead of the correct user one.


Note

Resolve relative copy target paths using the specified workdir or, if absent, the owner’s home directory.

  • Build/template – copy command:
    • Resolve relative TargetPath based on provided WorkDir; fallback to owner’s home directory via getent when unset.
    • Script now determines workdir, cds into it, then computes absolute targetPath.
    • Pass WorkDir and User from cmdMetadata into the copy script data.

Written by Cursor Bugbot for commit db87d10. This will update automatically on new commits. Configure here.

@dobrac dobrac added the bug Something isn't working label Nov 4, 2025
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@djeebus djeebus left a comment

Choose a reason for hiding this comment

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

It looks straight forward. Is this more intuitive than using the current working directory? What are we solving for here?

@dobrac dobrac force-pushed the fix-copy-home-directory branch from c660224 to 3469213 Compare November 4, 2025 20:38
@dobrac dobrac requested a review from djeebus November 4, 2025 20:41
# Fill the workdir with user home directory if empty
if [ -z "${workdir}" ]; then
# Use the owner's home directory
workdir=$(getent passwd "{{ .WorkdirUserHome }}" | cut -d: -f6)
Copy link

Choose a reason for hiding this comment

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

Bug: Template Mismatch Causes Script Execution Error

The copyScriptTemplate references {{ .WorkdirUserHome }} in the getent command, but the copyScriptData struct only defines a User field. This mismatch causes a template execution error when the script attempts to resolve the user's home directory.

Fix in Cursor Fix in Web

@dobrac dobrac force-pushed the fix-copy-home-directory branch from 395f2d5 to db87d10 Compare November 4, 2025 21:30
@dobrac dobrac enabled auto-merge (squash) November 4, 2025 21:32
@dobrac dobrac merged commit 638acde into main Nov 4, 2025
26 checks passed
@dobrac dobrac deleted the fix-copy-home-directory branch November 4, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants