Fix issue with submodule initialization in non-interactive run

This commit is contained in:
2025-09-13 20:12:37 -07:00
parent 7217ce8a41
commit 233378d20c
+10 -6
View File
@@ -249,11 +249,15 @@ function link_dotfiles {
}
function link_dotfiles_local() {
if [ ! -d "$dir/dependencies/dotfiles-local/" ]; then
echo "No local dotfiles found, could not sync. Please run:"
echo "> git submodule update --init"
echo "> $dir/dotfiles-local.sh {machine-name}"
return
if [ ! -d "$dir/dependencies/dotfiles-local/packages" ]; then
if [ "$interactive" == 0 ]; then
echo "No local dotfiles found, could not sync. Skipping"
else
echo "No local dotfiles found, could not sync. Please run:"
echo "> git submodule update --init"
echo "> $dir/dotfiles-local.sh {machine-name}"
return
fi
fi
cd "$dir/dependencies/dotfiles-local"
# Check if on main branch
@@ -821,7 +825,7 @@ if [ -t 0 ]; then
run_interactively
else
# Non-interactive session (e.g. Coder workspace initialization)
git submodule init --update
git submodule update --init
link_dotfiles
link_dotfiles_local
fi