Skip to content

Commit

Permalink
Sort commands by prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
vitobotta committed Nov 12, 2023
1 parent b23581d commit 12bcefe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync-history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if (( current_time - last_executed_time >= 30 )) || [ "$force_sync" = "-f" ]; th
fi

source_items=$(read_file $source_file)
items=$(echo -e "$new_items\n$source_items" | grep -v '^\:\s[<=>]\{3\}' | awk '!x[$0]++')
items=$(echo -e "$new_items\n$source_items" | grep -v '^\:\s[<=>]\{3\}' | awk '!x[$0]++' | sort -t ';' -k1,1)

echo -e "$items" > $source_file
echo -e "$items" | $GPG_CMD --encrypt --trust-model always --yes --recipient "$ZSH_HISTORY_SYNC_GPG_KEY_UID" --output "$sync_file" 2>/dev/null
Expand Down

0 comments on commit 12bcefe

Please sign in to comment.