From d44d8f96aa48c825c70c036d9344ab64b58f86e2 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 19 Jan 2026 09:36:00 -0600 Subject: 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. --- archsetup | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'archsetup') diff --git a/archsetup b/archsetup index e7242ca..197c1a0 100755 --- a/archsetup +++ b/archsetup @@ -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" "$?" -- cgit v1.2.3