mirror of
https://github.com/mollyim/ringrtc.git
synced 2025-05-13 13:50:42 +01:00
43 lines
907 B
Python
43 lines
907 B
Python
#!/usr/bin/env python
|
|
|
|
#
|
|
# Copyright 2019-2021 Signal Messenger, LLC
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
#
|
|
|
|
# Simple pass through wrapper for calling cargo
|
|
|
|
# ------------------------------------------------------------------------------
|
|
#
|
|
# Imports
|
|
#
|
|
|
|
try:
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
except ImportError as e:
|
|
raise ImportError(str(e) + "- required module not found")
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
#
|
|
# Main
|
|
#
|
|
def main():
|
|
|
|
work_dir = os.path.normpath(os.path.join(os.path.dirname(sys.argv[0]), '..'))
|
|
sys.stderr.write("cargo: Entering directory `" + work_dir + "'\n")
|
|
os.chdir(work_dir)
|
|
cmd = [ "cargo" ] + sys.argv[1:]
|
|
sys.stderr.write("cargo command: " + str(cmd))
|
|
subprocess.check_call(cmd)
|
|
return 0
|
|
|
|
|
|
# --------------------
|
|
#
|
|
# execution check
|
|
#
|
|
if __name__ == '__main__':
|
|
exit(main())
|