Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Ignore OSX-generated subfolders found in the archive
Browse files Browse the repository at this point in the history
  • Loading branch information
lmperry committed Dec 12, 2018
1 parent 1c92124 commit 2cf0b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"source": "https://github.com/scitran-apps/dcm2niix",
"license": "BSD-2-Clause",
"flywheel": "0",
"version": "0.7.5_1.0.20180622_5af76a9",
"version": "0.7.6_1.0.20180622_5af76a9",
"custom": {
"docker-image": "scitran/dcm2niix:0.7.5_1.0.20180622_5af76a9",
"docker-image": "scitran/dcm2niix:0.7.6_1.0.20180622_5af76a9",
"flywheel": {
"uid": 1000,
"gid": 1000
Expand Down
8 changes: 4 additions & 4 deletions run_dcm2niix
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ if [[ "$input_file" == *.zip ]] ; then
echo "$CONTAINER Unzipping $input_file"
unzip -q -B "$input_file" -d $INPUT_DIR

# Find unzipped directory in input dir
dicom_input=$(find $INPUT_DIR/* -not -path '*/\.*' -type d | head -1)
# Find unzipped sub-directory within the input directory
dicom_input=$(find $INPUT_DIR/* -not -path '*/\.*' -not -path '__MACOSX' -type d | head -1)

# If there is no unzipped directory, check for PAR/REC files
# If there is no unzipped sub-directory, check for PAR/REC files at the top-level
if [[ -z "$dicom_input" ]]; then
dicom_input=$(find $INPUT_DIR/* -not -path '*/\.*' -type f -name "*.par" -o -name "*.PAR" | head -1)
fi

# Zip bomb: Set dicom_input to INPUT_DIR
# Zip bomb: DICOMS are at the top level -- set dicom_input to INPUT_DIR
if [[ -z "$dicom_input" ]]; then
dicom_input=$INPUT_DIR
fi
Expand Down

0 comments on commit 2cf0b89

Please sign in to comment.