Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
54 lines (47 loc) · 1.81 KB

File metadata and controls

executable file
·
54 lines (47 loc) · 1.81 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Igalia S.L.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import os
import subprocess
import sys
scriptdir = os.path.abspath(os.path.dirname(__file__))
SDK_PROJECT_PATH = os.path.join(scriptdir, "..", "buildstream")
PIPENV_PIPFILE = os.path.realpath(os.path.join(SDK_PROJECT_PATH, "Pipfile"))
def run_pipenv(args: list, **kw) -> subprocess.CompletedProcess:
local_env = {
"PIPENV_VENV_IN_PROJECT": "1",
"PIPENV_PIPFILE": PIPENV_PIPFILE
}
kw["env"] = os.environ
kw["env"].update(local_env)
return subprocess.run(["pipenv", ] + args, **kw)
def ensure_environment():
result = run_pipenv(["--venv",], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if result.returncode != 0:
run_pipenv(["install"])
def run_bst(args: list) -> subprocess.CompletedProcess:
return run_pipenv(["run", "bst", "-C", SDK_PROJECT_PATH] + args)
def main(args: list) -> int:
ensure_environment()
if args[0] == "pipenv":
run_pipenv(args[1:])
else:
run_bst(args)
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
Morty Proxy This is a proxified and sanitized view of the page, visit original site.