Skip to content

Commit

Permalink
Sort using the default temp location
Browse files Browse the repository at this point in the history
Not sure what motivated this (maybe running out of space in the default
temp location) but sorting in the default application working directory
won't work now because of the way permissions are set in the
application.
  • Loading branch information
aelkiss committed Jun 6, 2024
1 parent f3ba543 commit 701c1e7
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 701c1e7

Please sign in to comment.