diff --git a/.github/workflows/zenodo.py b/.github/workflows/zenodo.py index ca62973..b067029 100644 --- a/.github/workflows/zenodo.py +++ b/.github/workflows/zenodo.py @@ -35,6 +35,18 @@ def deposit(zenodo_url, access_token, dep_id, upload_file, meta): print("New deposition ID: {}".format(dep_id)) + # Delete previous files (all current) + # Get list of files + url = '{}/{}/files'.format(urlbase, dep_id) + r = requests.get(url, params=params) + if r.status_code != 200: + raise RuntimeError('GET {} failed: {}'.format(url, r.status_code)) + print(f'Existing files: {r.json()}') + + for files in r.json(): + url = '{}/{}/files/{}'.format(urlbase, dep_id, files['id']) + r = requests.delete(url, params=params) + # Upload the file data = {'filename': op.basename(upload_file)} files = {'file': open(upload_file, 'rb')} diff --git a/build_specification/build_specification_pdf b/build_specification/build_specification_pdf index 03b5de3..1deb2a2 100755 --- a/build_specification/build_specification_pdf +++ b/build_specification/build_specification_pdf @@ -1,4 +1,4 @@ #!/bin/bash version=`git tag` -echo "${version/./_}" -pandoc specification.MD -t html -o - | pandoc -f html --pdf-engine=xelatex -V geometry:margin=1in -V mainfont:Roboto -o "nifti_mrs_specification_${version/./_}.pdf" \ No newline at end of file +echo "${version//./_}" +pandoc specification.MD -t html -o - | pandoc -f html --pdf-engine=xelatex -V geometry:margin=1in -V mainfont:Roboto -o "nifti_mrs_specification_${version//./_}.pdf" \ No newline at end of file