Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mfshao committed Aug 7, 2024
1 parent 8752c6a commit 930c08c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sidecar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,27 @@ function populate() {
# make sure folder can be written to by notebook
chown -R 1000:100 $FOLDER

if ["$base_dir" = "manifests"];then
if [[ "$base_dir" == "manifests"]]; then
MANIFEST_FILE=$(curl -s -H "Authorization: Bearer ${ACCESS_TOKEN}" "https://$GEN3_ENDPOINT/manifests/file/$FILENAME")
echo "${MANIFEST_FILE}" > $FOLDER/manifest.json
log "Creating notebook for $FILENAME"
cp ./template_manifest.json $FOLDER/data.ipynb
populate_notebook "$MANIFEST_FILE" "$FOLDER"
elif ["$base_dir" = "metadata"];then
elif [["$base_dir" = "metadata"]]; then
METADATA_FILE=$(curl -s -H "Authorization: Bearer ${ACCESS_TOKEN}" "https://$GEN3_ENDPOINT/manifests/metadata/$FILENAME")
echo "${METADATA_FILE}" > $FOLDER/metadata.json
fi
fi
done
}
# echo $MANIFEST_FILE | jq -c '.manifests' | process_files manifests
process_files "manifests" "$(echo $MANIFEST_FILE | jq -c '.manifests')"
if [ ! -z "$MANIFEST_FILE" ]; then
process_files "manifests" "$(echo $MANIFEST_FILE | jq -c '.manifests')"
fi
if [ ! -z "$METADATA_FILE" ]; then
# echo $METADATA_FILE | jq -c '.external_file_metadata' | process_files metadata
process_files "metadata" "$(echo $METADATA_FILE | jq -c '.external_file_metadata')"
process_files "metadata" "$(echo $METADATA_FILE | jq -c '.external_file_metadata')"
fi

# Make sure notebook user has write access to the folders
chown -R 1000:100 /data
Expand Down

0 comments on commit 930c08c

Please sign in to comment.