Skip to content

Commit b1e7b65

Browse files
committed
add option to continue with existing file
1 parent e892afd commit b1e7b65

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mimic-iv/buildmimic/duckdb/import_duckdb.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ elif [ -n "$3" ]; then
5757
yell "import.sh takes a maximum of two arguments."
5858
die "Usage: ./import_duckdb.sh mimic_data_dir [output_db]"
5959
elif [ -s "$OUTFILE" ]; then
60-
yell "File \"$OUTFILE\" already exists."
61-
die "Please specify an alternate output db name."
60+
yell "File \"$OUTFILE\" already exists."
61+
read -p "Continue? (y/d/n) 'y' continues, 'd' deletes original file, 'n' stops: " yn
62+
case $yn in
63+
[Yy]* ) ;; # OK
64+
[Nn]* ) exit;;
65+
[Dd]* ) rm "$OUTFILE";;
66+
* ) die "Unrecognized input.";;
67+
esac
6268
fi
6369

6470
# we will copy the postgresql create.sql file, and apply regex

0 commit comments

Comments
 (0)