From 6be6e096be026c6b420921813b8e8db03ca65661 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Tue, 18 Jun 2024 00:29:03 -0400 Subject: [PATCH] Update install_data.sh --- install_data.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/install_data.sh b/install_data.sh index 70b3580..96a5413 100644 --- a/install_data.sh +++ b/install_data.sh @@ -4,15 +4,24 @@ # Test data is hosted on Google Drive at: # https://drive.google.com/u/0/uc?id=1i1GA4AZhuw6Si8RmPFPJxmejIUt3ZZ1D +fileid=1i1GA4AZhuw6Si8RmPFPJxmejIUt3ZZ1D + filename=test_nucleo_qc.tar.gz -# Note: Drive seems to change somewhat frequently how it handles endpoints for large files -# add confirm parameter to link for this to work -# previously used another wget scheme and gdown -wget -O $filename "https://drive.google.com/u/0/uc?id=1i1GA4AZhuw6Si8RmPFPJxmejIUt3ZZ1D&export=download&confirm=t" +foldername=test_nucleo_qc + +# Skip if already have test data +[[ -f $filename ]] && exit 0 +[[ -d $foldername ]] && exit 0 + +curl -c ./cookie -s -k -L "https://drive.google.com/uc?export=download&id=$fileid" > /dev/null + +curl -k -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename} + # Suppress linux warnings for MacOS tar.gz files if [[ "$OSTYPE" == "linux-gnu" ]]; then - tar --warning=no-unknown-keyword -xzvf $filename -C tests/inputs/ + tar --warning=no-unknown-keyword -xzvf $filename elif [[ "$OSTYPE" == "darwin"* ]]; then - tar -xzvf $filename -C tests/inputs/ + tar -xzvf $filename fi + rm $filename \ No newline at end of file