Compare commits
1 Commits
8b36bf9421
...
6273e833f8
Author | SHA1 | Date | |
---|---|---|---|
6273e833f8 |
15
Makefile
15
Makefile
@ -1,15 +0,0 @@
|
|||||||
.PHONY: default venv install dev clean
|
|
||||||
|
|
||||||
default: dev
|
|
||||||
|
|
||||||
venv:
|
|
||||||
@[ ! -d ./venv ] && python3 -m venv venv || true
|
|
||||||
|
|
||||||
require: venv
|
|
||||||
@bash -c "source venv/bin/activate && pip install -r requirements.txt"
|
|
||||||
|
|
||||||
dev: require
|
|
||||||
@bash -c "source venv/bin/activate && pip install -e ."
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf venv dist tarc.egg-info
|
|
@ -1,7 +1,4 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "tarc"
|
name = "tarc"
|
||||||
version = "0.0.1dev3"
|
version = "0.0.1dev2"
|
||||||
description = "Manage BT archives"
|
description = "Manage BT archives"
|
||||||
|
|
||||||
[project.scripts]
|
|
||||||
tarc = "tarc:main"
|
|
||||||
|
20
tarc.sh
Executable file
20
tarc.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Create a virtual environment if it does not exist
|
||||||
|
if [ ! -d "venv" ]; then
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
python3 -m venv venv && \
|
||||||
|
source venv/bin/activate && \
|
||||||
|
pip install -r requirements.txt && \
|
||||||
|
deactivate
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Activate the virtual environment
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
# Run the Python script
|
||||||
|
python tarc/main.py "$@"
|
||||||
|
|
||||||
|
# Deactivate the virtual environment
|
||||||
|
deactivate
|
@ -1,5 +0,0 @@
|
|||||||
"""
|
|
||||||
tarc - Manage BT archives
|
|
||||||
"""
|
|
||||||
|
|
||||||
from .main import main
|
|
13
tarc/main.py
13
tarc/main.py
@ -154,11 +154,6 @@ def list_clients(conn):
|
|||||||
return rows
|
return rows
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""
|
|
||||||
Entrypoint of the program.
|
|
||||||
"""
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Manage BT archives", prog="tarc")
|
parser = argparse.ArgumentParser(description="Manage BT archives", prog="tarc")
|
||||||
subparsers = parser.add_subparsers(
|
subparsers = parser.add_subparsers(
|
||||||
dest="command", required=True, help="Available commands"
|
dest="command", required=True, help="Available commands"
|
||||||
@ -260,14 +255,8 @@ def main():
|
|||||||
print(f"[DEBUG]: Tracker {repr(elem)}")
|
print(f"[DEBUG]: Tracker {repr(elem)}")
|
||||||
print("\n", end="")
|
print("\n", end="")
|
||||||
else:
|
else:
|
||||||
print(
|
print(f'[ERROR]: Multiple clients ({len(clients)}) using "{args.endpoint}"')
|
||||||
f'[ERROR]: Multiple clients ({len(clients)}) using "{args.endpoint}"'
|
|
||||||
)
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print("[ERROR]: Must specify directory OR client endpoint")
|
print("[ERROR]: Must specify directory OR client endpoint")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user