Fix jj identity check in init.sh

jj config get exits 0 for empty defaults, so the old exit-code check
always concluded name/email were already set. Switch to checking the
actual output value instead.
This commit is contained in:
Sami Samhuri 2026-05-02 09:26:25 -07:00 committed by Sami Samhuri
parent 95222a65b9
commit 468acc22c7

View file

@ -67,14 +67,14 @@ setup_jj_identity() {
return 0
fi
if ! jj config get user.name >/dev/null 2>&1; then
if [ -z "$(jj config get user.name 2>/dev/null)" ]; then
jj config set --user user.name "Sami Samhuri"
echo "→ Set jj user.name"
else
echo "✓ jj user.name already set"
fi
if ! jj config get user.email >/dev/null 2>&1; then
if [ -z "$(jj config get user.email 2>/dev/null)" ]; then
jj config set --user user.email "sami@samhuri.net"
echo "→ Set jj user.email"
else