feat: add self-update command and bump to 2.0.1
- Add `coinhunter update` CLI command for pipx/pip upgrade - README: document update behavior and recommend pipx install - Dynamic version badge with cacheSeconds=60 - Version bump: 2.0.0 → 2.0.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ from . import __version__
|
||||
from .binance.spot_client import SpotBinanceClient
|
||||
from .binance.um_futures_client import UMFuturesClient
|
||||
from .config import ensure_init_files, get_binance_credentials, load_config
|
||||
from .runtime import get_runtime_paths, print_json
|
||||
from .runtime import get_runtime_paths, print_json, self_update
|
||||
from .services import account_service, market_service, opportunity_service, trade_service
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
scan_parser = opportunity_subparsers.add_parser("scan")
|
||||
scan_parser.add_argument("--symbols", nargs="*")
|
||||
|
||||
subparsers.add_parser("update", help="Upgrade coinhunter to the latest version")
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
@@ -231,6 +233,10 @@ def main(argv: list[str] | None = None) -> int:
|
||||
return 0
|
||||
parser.error("opportunity requires `portfolio` or `scan`")
|
||||
|
||||
if args.command == "update":
|
||||
print_json(self_update())
|
||||
return 0
|
||||
|
||||
parser.error(f"Unsupported command {args.command}")
|
||||
return 2
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user