2020-12-20 08:02:32 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2020-01-07 05:23:38 +00:00
|
|
|
"""
|
|
|
|
proxy.py
|
|
|
|
~~~~~~~~
|
|
|
|
⚡⚡⚡ Fast, Lightweight, Programmable, TLS interception capable
|
|
|
|
proxy server for Application debugging, testing and development.
|
|
|
|
|
|
|
|
:copyright: (c) 2013-present by Abhinav Singh and contributors.
|
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
import sys
|
2020-12-20 08:02:32 +00:00
|
|
|
import subprocess
|
2020-01-07 05:23:38 +00:00
|
|
|
from proxy.common.version import __version__ as lib_version
|
|
|
|
|
|
|
|
# This script ensures our versions never run out of sync.
|
|
|
|
#
|
2020-12-20 08:02:32 +00:00
|
|
|
# 1. TODO: Version is hardcoded in homebrew stable package
|
2020-01-07 19:38:25 +00:00
|
|
|
# installer file, but it only needs to match with lib
|
|
|
|
# versions if current git branch is master
|
2020-12-20 08:02:32 +00:00
|
|
|
|
|
|
|
# Version is also hardcoded in README.md flags section
|
|
|
|
readme_version_cmd = 'cat README.md | grep "proxy.py v" | tail -2 | head -1 | cut -d " " -f 2 | cut -c2-'
|
|
|
|
readme_version_output = subprocess.check_output(
|
|
|
|
['bash', '-c', readme_version_cmd])
|
|
|
|
readme_version = readme_version_output.decode().strip()
|
|
|
|
|
|
|
|
if readme_version != lib_version:
|
|
|
|
print('Version mismatch found. {0} (readme) vs {1} (lib).'.format(
|
|
|
|
readme_version, lib_version))
|
2020-01-07 05:23:38 +00:00
|
|
|
sys.exit(1)
|