Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort using the default temp location #307

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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