30 lines
731 B
Python
30 lines
731 B
Python
#!/usr/bin/env python3
|
|
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
|
|
def _bootstrap_project_root() -> None:
|
|
project_root = Path(__file__).resolve().parents[1]
|
|
project_root_text = str(project_root)
|
|
if project_root_text not in sys.path:
|
|
sys.path.insert(0, project_root_text)
|
|
|
|
|
|
_bootstrap_project_root()
|
|
|
|
from inventory_analytics.channel_inventory_sync.entrypoint import main
|
|
|
|
|
|
def _ensure_default_action() -> None:
|
|
if any(arg in {"-h", "--help"} for arg in sys.argv[1:]):
|
|
return
|
|
if any(arg == "--action" or arg.startswith("--action=") for arg in sys.argv[1:]):
|
|
return
|
|
sys.argv.extend(["--action", "all"])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
_ensure_default_action()
|
|
raise SystemExit(main())
|