diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-19 09:36:00 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-19 09:36:00 -0600 |
| commit | d44d8f96aa48c825c70c036d9344ab64b58f86e2 (patch) | |
| tree | 28d486e7984506895cb58780e4fad0e83f0bf74d | |
| parent | a8f40562f877af12ffbe4261e81094da61ba8895 (diff) | |
fix(archsetup): clone repo instead of copying for curl|bash support
When run via curl|bash, archsetup_dir resolves to /root with no files.
Now clones from git.cjennings.net instead of copying local files.
| -rwxr-xr-x | archsetup | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -615,13 +615,13 @@ create_user () { user_customizations() { action="User Customizations" && display "title" "$action" - # Copy archsetup to user's home directory so dotfile symlinks are accessible. - # Without this, stow creates symlinks pointing to wherever archsetup was run from - # (e.g., /root/archsetup), which the user cannot read after login. + # Clone archsetup to user's home directory so dotfile symlinks are accessible. + # This ensures symlinks point to a user-readable location regardless of how + # archsetup was invoked (curl|bash, from /root, etc.) user_archsetup_dir="/home/$username/code/archsetup" - action="copying archsetup to user's home directory" && display "task" "$action" - (mkdir -p "$user_archsetup_dir" && \ - cp -r "$archsetup_dir"/* "$user_archsetup_dir/" && \ + action="cloning archsetup to user's home directory" && display "task" "$action" + (mkdir -p "$(dirname "$user_archsetup_dir")" && \ + git clone --depth 1 https://git.cjennings.net/archsetup.git "$user_archsetup_dir" && \ chown -R "$username": "/home/$username/code" \ >> "$logfile" 2>&1) || error "error" "$action" "$?" |
