diff --git a/Dockerfile b/Dockerfile index 02f1c38..f422a23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN apt-get -y install breeze-icon-theme python3-venv # clean up RUN apt-get clean -ARG SQUIRREL_VERSION=0.4.0 +ARG SQUIRREL_VERSION=0.4.1 COPY dist/squirrel-${SQUIRREL_VERSION}-py3-none-any.whl squirrel-${SQUIRREL_VERSION}-py3-none-any.whl @@ -44,6 +44,8 @@ RUN /opt/squirrel/bin/pip install squirrel-${SQUIRREL_VERSION}-py3-none-any.whl RUN /opt/squirrel/bin/pip install gunicorn COPY squirrel-cmd /opt/squirrel/bin/squirrel +ENV PATH /opt/squirrel/bin:${PATH} + ENV SQUIRREL_CONFIG /etc/squirrel/config.json EXPOSE 8000 diff --git a/pyproject.toml b/pyproject.toml index f7a5089..7f53df8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "squirrel" -version = "0.4.0" +version = "0.4.1" description = "Find your nuts" authors = [ {name = "trisf"} @@ -13,8 +13,8 @@ dependencies = [ "dotenv (>=0.9.9,<0.10.0)" ] -#[project.scripts] -#"squirrel" = "squirrel.server:daemon" +[project.scripts] +"sqindex" = "squirrel.cmd:reindex" [build-system] requires = ["poetry-core>=2.0.0,<3.0.0"] diff --git a/squirrel/cmd.py b/squirrel/cmd.py new file mode 100644 index 0000000..50aef2c --- /dev/null +++ b/squirrel/cmd.py @@ -0,0 +1,17 @@ +from squirrel.repo import get_archive +import shutil +import sys + +archive = get_archive() + + +def reindex(): + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument("repo") + options = parser.parse_args() + + p = archive.reindex(options.repo) + for line in p.stderr: + sys.stderr.write(line.decode("utf8"))