Skip to content

Commit

Permalink
moved sort to end
Browse files Browse the repository at this point in the history
  • Loading branch information
athalhammer committed Aug 30, 2020
1 parent 3806753 commit ab031be
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions script/dank.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ fi
if [ "$1" == "ALL" ]; then
filename=$(date +"%Y-%m-%d").all"$project".links
if languages=$(./script/get_languages.sh "$project"); then
for i in $languages; do
./script/create_links.sh "$i" "$project" "$dump_time" "$folder" >> "$filename.files.txt"
done

# collect
for i in $languages; do
./script/create_links.sh "$i" "$project" "$dump_time" "$folder" >> "$filename.files.txt"
done

# merge
while IFS= read -r i
do
cat "$i" >> "$filename"
done < <(cat "$filename.files.txt")

sort -k 1,1n -T . -S 50% -o "$filename" "$filename"

# collect stats
while IFS= read -r i
do
Expand All @@ -85,6 +86,9 @@ if [ "$1" == "ALL" ]; then
do
rm "$i"
done < <(cat "$filename.files.txt")

# sort
sort -k 1,1n -T . -S 50% -o "$filename" "$filename"
else
(>&2 printf "[Error]\tCouldn't retrieve languages...\n")
exit 1
Expand Down

0 comments on commit ab031be

Please sign in to comment.