24 lines
594 B
Python
Executable File
24 lines
594 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
# Copyright 2021-2023 Teemu Ikonen
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
|
|
script = os.path.realpath(sys.argv[0])
|
|
script_dir = os.path.dirname(script)
|
|
prefix = os.path.abspath(os.path.normpath(
|
|
os.path.join(script_dir, '..')))
|
|
src_dir = prefix
|
|
|
|
if os.path.exists(os.path.join(src_dir, 'satellite/__init__.py')):
|
|
# Run from local source folder
|
|
sys.path.insert(0, src_dir)
|
|
|
|
from satellite.__main__ import main
|
|
if __name__ == '__main__':
|
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
|
sys.exit(main())
|