platform/workers/transactor/calc.sh
Andrey Sobolev 4ec92d94b7
Some checks are pending
CI / test (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
UBERF-8968: Get rid of prosemirror in transactor (#7746)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
2025-01-21 23:49:45 +07:00

23 lines
664 B
Bash
Executable File

#!/bin/bash
files=$(cat ./dist/index.js|grep node_modules | grep //)
declare -a file_info
# Iterate over each line in $files
while IFS= read -r line; do
file=${line##*//}
size=$(ls -l $file 2>/dev/null | awk '{print $5}')
# echo "Processing: $file $size"
if [ ! -z "$size" ]; then
# Store size and path together
file_info+=("$size:$file")
fi
done <<< "$files"
# Sort the array by size (numerically, in descending order) and print
printf '%s\n' "${file_info[@]}" | sort -t: -k1,1nr | while IFS=: read -r size path; do
if [ $(($size/1024)) -ne 0 ]; then
echo "Size: $(($size/1024)) KB - $path"
fi
done