Skip to content

Commit

Permalink
Merge pull request #307 from hathitrust/sort-in-default-tmp
Browse files Browse the repository at this point in the history
Sort using the default temp location
  • Loading branch information
aelkiss authored Jun 6, 2024
2 parents f3ba543 + 701c1e7 commit 34e044f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/scrub/chunker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def validate
def run
# First we need to get all the data from @glob into one file.
# `split --number=l/x` only works on files, not on STDIN.
# TODO: we might want another dir for sort -T .
tmp_file = File.join(@tmp_chunk_dir, "tmp_sorted.txt")
add_uuid_call = @add_uuid ? "| bundle exec ruby bin/add_uuid.rb" : ""
# Sort call explained:
Expand All @@ -50,7 +49,7 @@ def run
# -n = numeric sort so [1, 3, 20] instead of [1, 20, 3]
# -T ./ = put temporary files in the current directory
sort_call = "egrep -vh '^OCN' #{@glob} | " \
"sort -t: -k2,2 -s -n -T ./ " \
"sort -t: -k2,2 -s -n" \
"#{add_uuid_call} " \
"> #{tmp_file}"
Services.logger.info sort_call
Expand Down

0 comments on commit 34e044f

Please sign in to comment.