simonw / datasette-publish-vercel

Datasette plugin for publishing data using Vercel
Apache License 2.0
44 stars 7 forks source link

datasette publish: error using custom template #21

Open aborruso opened 4 years ago

aborruso commented 4 years ago

Hi, I have created a template folder and I have put inside it a copy of base.html and index.html official template files.

I have edited nothing, and then run (to make a test) simply

datasette publish now mydb.db --project=my-database --template-dir=template

I have the error below. What's wrong in my procedure or in my system?

Thank you

Traceback (most recent call last):
  File "/home/aborruso/.local/lib/python3.7/site-packages/datasette/utils/__init__.py", line 607, in link_or_copy_directory
    shutil.copytree(src, dst, copy_function=os.link)
  File "/usr/lib/python3.7/shutil.py", line 365, in copytree
    raise Error(errors)
shutil.Error: [('/myfolderproject/processing/template/base.html', '/tmp/tmpfccqqfod/datasette-now-v2/templates/base.html', "[Errno 18] Invalid cross-device link: '/myfolderproject/processing/template/ba
se.html' -> '/tmp/tmpfccqqfod/datasette-now-v2/templates/base.html'"), ('/myfolderproject/processing/template/index.html', '/tmp/tmpfccqqfod/datasette-now-v2/templates/index.html', "[Errno 18] Invalid cross-device link: '/mnt/c/Users/aborr/Do
cuments/GitHub/youtubeComunePalermo/processing/template/index.html' -> '/tmp/tmpfccqqfod/datasette-now-v2/templates/index.html'")]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/aborruso/.local/bin/datasette", line 8, in <module>
    sys.exit(cli())
  File "/home/aborruso/.local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/aborruso/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/aborruso/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/aborruso/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/aborruso/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/aborruso/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/aborruso/.local/lib/python3.7/site-packages/datasette_publish_now/__init__.py", line 118, in now
    port=8080,
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/aborruso/.local/lib/python3.7/site-packages/datasette/utils/__init__.py", line 396, in temporary_docker_directory
    os.path.join(datasette_dir, "templates"),
  File "/home/aborruso/.local/lib/python3.7/site-packages/datasette/utils/__init__.py", line 609, in link_or_copy_directory
    shutil.copytree(src, dst)
  File "/usr/lib/python3.7/shutil.py", line 321, in copytree
    os.makedirs(dst)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/tmp/tmpfccqqfod/datasette-now-v2/templates'