Added index command
This commit is contained in:
parent
66eed73c0e
commit
128f34c997
@ -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
|
||||
|
||||
@ -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"]
|
||||
|
||||
17
squirrel/cmd.py
Normal file
17
squirrel/cmd.py
Normal file
@ -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"))
|
||||
Loading…
x
Reference in New Issue
Block a user