FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
aws-lambda-builders/aws_lambda_builders/path_resolver.py at develop · aavinav/aws-lambda-builders · GitHub
aavinav
/
aws-lambda-builders
Public
forked from
aws/aws-lambda-builders
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
aws-lambda-builders
/
aws_lambda_builders
/
path_resolver.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (23 loc) · 1006 Bytes
Breadcrumbs
aws-lambda-builders
/
aws_lambda_builders
/
path_resolver.py
Copy path
File metadata and controls
29 lines (23 loc) · 1006 Bytes
Raw
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
"""
Basic Path Resolver that looks for the executable by runtime first, before proceeding to 'language' in PATH.
"""
from
aws_lambda_builders
.
utils
import
which
class
PathResolver
(
object
):
def
__init__
(
self
,
binary
,
runtime
,
executable_search_paths
=
None
):
self
.
binary
=
binary
self
.
runtime
=
runtime
self
.
executables
=
[
self
.
runtime
,
self
.
binary
]
self
.
executable_search_paths
=
executable_search_paths
def
_which
(
self
):
exec_paths
=
[]
for
executable
in
[
executable
for
executable
in
self
.
executables
if
executable
is
not
None
]:
paths
=
which
(
executable
,
executable_search_paths
=
self
.
executable_search_paths
)
exec_paths
.
extend
(
paths
)
if
not
exec_paths
:
raise
ValueError
(
"Path resolution for runtime: {} of binary: "
"{} was not successful"
.
format
(
self
.
runtime
,
self
.
binary
)
)
return
exec_paths
@
property
def
exec_paths
(
self
):
return
self
.
_which
()
Back
|
FazBrowse Home
|
New Git URL