Skip to content

Commit

Permalink
Change TMPDIR env variable for sort command
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha authored Jan 6, 2023
1 parent aaa51d0 commit b106ff1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/build_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ TAXA="1"
VERBOSE="false"
SORT_MEMORY="2g"

OLD_TMPDIR="$TMPDIR"

printHelp() {
cat << END
Usage: $(basename "$0") [OPTIONS] BUILD_TYPE DB_NAMES DB_SOURCES OUTPUT_DIR
Expand Down Expand Up @@ -84,6 +86,7 @@ END
clean() {
# Clean contents of temporary directory
rm -rf "$TEMP_DIR/$UNIPEPT_TEMP_CONSTANT"
export TMPDIR="$OLD_TMPDIR"
}

# Stop the script and remove all temporary files that are created by this script.
Expand Down Expand Up @@ -201,9 +204,9 @@ do
v)
VERBOSE="true"
;;
\? )
printUsageAndExit
;;
\? )
printUsageAndExit
;;
esac
done

Expand All @@ -220,6 +223,9 @@ then
printUnknownOptionAndExit
fi

# This is required for the sort command to use the correct temp directory
EXPORT TMPDIR="$TEMP_DIR"

BUILD_TYPE="$1"

OLDIFS="$IFS"
Expand Down

0 comments on commit b106ff1

Please sign in to comment.