aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/with_pathsep_resolve.py
blob: 80fb5499d2bb8b7bc8fa4fe3ee9d6ee849334cbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys
import os
import subprocess
import platform


# NOTE: legacy, only for "devtools/ya/jbuild"
def fix_args(args):
    just_replace_it = False
    for arg in args:
        if arg == '--fix-path-sep':
            just_replace_it = True
            continue
        if just_replace_it:
            arg = arg.replace('::', os.pathsep)
            just_replace_it = False
        yield arg


if __name__ == '__main__':
    res = list(fix_args(sys.argv[1:]))
    if platform.system() == 'Windows':
        sys.exit(subprocess.Popen(res).wait())
    else:
        os.execv(res[0], res)