Closed oliverandrich closed 10 months ago
@jefftriplett @oryon-dominik I like to have some comments from you before implementing.
The basic idea is obvious. If TAILWIND_CLI_PATH points to an existing directory, I try to find a suitable executable inside the directory. If non exists I will download it as the library has been doing from the beginning.
If TAILWIND_CLI_PATH points to an existing file, we skip the download process and just use the binary.
But what should the library if the path from TAILWIND_CLI_PATH does not exist in the filesystem? Currently, it assumes it is an directory and creates it in case it is missing. Then it downloads the CLI to this directory.
What would be your expectation if the TAILWIND_CLI_PATH is set to ~/Bin/tailwind-windows-x64-3.3.5.exe
or to add an extra level of ambiguity ~/bin/tailwind-linux-arm64-3.3.5
? Is this a path or not? Should I expect TAILWIND_CLI_PATH to end with an / if it is a path and otherwise treat it as a file?
Thanks for your input.
Personal taste:
TAILWIND_CLI_AUTO_DOWNLOAD = False
). That means failing otherwise.tailwind.config.js
to be part of that TAILWIND_BASE_DIR
.Regards
I ended up with settings.TAILWINDCSS_VERSION = "3.3.5"
and calling (without any of the other config):
RUN DATABASE_URL=sqlite://:memory: python manage.py tailwind --skip-checks build
I originally thought if TAILWIND_BASE_PATH
were pointing at a binary it should use it. Upon further reading, it was more clear that you were using it for the folder where the binary should live.
I would probably do a check to see:
TAILWIND_BASE_PATH
exists and is an executable then run it. I implemented the behaviour that TAILWIND_CLI_PATH
can also point to an pre-installed binary. I also added the setting TAILWIND_CLI_AUTOMATIC_DOWNLOAD
to enable (default) or disable the automatic download of the CLI if none is found locally.
This is working great on Windows. Thanks.
Discussed in https://github.com/oliverandrich/django-tailwind-cli/discussions/65