-
Notifications
You must be signed in to change notification settings - Fork 219
fix: template build home directory for relative paths #1438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
djeebus
left a comment
There was a problem hiding this 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?
c660224 to
3469213
Compare
| # 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) |
There was a problem hiding this comment.
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.
395f2d5 to
db87d10
Compare
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.
TargetPathbased on providedWorkDir; fallback to owner’s home directory viagetentwhen unset.workdir,cds into it, then computes absolutetargetPath.WorkDirandUserfromcmdMetadatainto the copy script data.Written by Cursor Bugbot for commit db87d10. This will update automatically on new commits. Configure here.