Skip to content

Commit 57b0b85

Browse files
committed
feat: enhance update functions to display applied changes after synchronization
1 parent 146d9ae commit 57b0b85

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

update/__update_git_sync.fish

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ function __update_git_sync -d 'Synchronize Cauldron installation with remote rep
100100
end
101101

102102
echo "✓ Code updated successfully"
103+
echo ""
103104

104-
# Store local and remote hashes for completion message
105-
set -g __UPDATE_LOCAL_HASH $local_hash
106-
set -g __UPDATE_REMOTE_HASH $remote_hash
105+
# Show what changed
106+
echo "Changes applied:"
107+
git -C "$CAULDRON_PATH" log --oneline --decorate $local_hash..HEAD | head -n 10
107108

108109
return 0
109110
end

update/cauldron_update.fish

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ function cauldron_update -d 'Update Cauldron to the latest version'
5050
# ============================================================================
5151

5252
set -l check_only_flag (set -q _flag_check_only && echo "1" || echo "0")
53-
set -l git_status (__update_git_sync $branch $check_only_flag)
53+
__update_git_sync $branch $check_only_flag
54+
set -l git_status $status
5455

5556
switch $git_status
5657
case 0
@@ -243,18 +244,6 @@ function cauldron_update -d 'Update Cauldron to the latest version'
243244

244245
echo ""
245246
echo "✨ Cauldron updated successfully!"
246-
echo ""
247-
248-
# Show changelog if we have the hash values from git sync
249-
if set -q __UPDATE_LOCAL_HASH; and set -q __UPDATE_REMOTE_HASH
250-
echo "Changes applied:"
251-
git -C "$CAULDRON_PATH" log --oneline --decorate $__UPDATE_LOCAL_HASH..$__UPDATE_REMOTE_HASH
252-
253-
# Clean up global variables
254-
set -e __UPDATE_LOCAL_HASH
255-
set -e __UPDATE_REMOTE_HASH
256-
end
257-
258247
echo ""
259248
echo "Please restart your Fish shell to use the updated version:"
260249
echo " exec fish"

0 commit comments

Comments
 (0)