Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed May 13, 2024
1 parent 83b6c84 commit 17dabe4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion localstack/packages/cdklocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from functools import lru_cache
from typing import List

from localstack.packages import Package, PackageInstaller
from localstack.packages import InstallTarget, Package, PackageInstaller
from localstack.packages.core import NodePackageInstaller

DEFAULT_CDKLOCAL_VERSION = "2.18.0"
Expand All @@ -29,6 +29,10 @@ def __init__(self, version: str):
version=version,
)

def _get_install_dir(self, target: InstallTarget) -> str:
# get the global node install path
return os.path.join(target.value, "node-packages")

def _get_install_marker_path(self, install_dir: str) -> str:
return os.path.join(
install_dir,
Expand Down
4 changes: 4 additions & 0 deletions localstack/packages/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ def _get_github_asset_name(self) -> str:
raise NotImplementedError()


# class NodeExecutablePackageInstaller(ExecutableInstaller):
# def __init__(self, package_namep


class NodePackageInstaller(ExecutableInstaller):
"""Package installer for Node / NPM packages."""

Expand Down
6 changes: 5 additions & 1 deletion localstack/runtime/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ class ShellScriptRunner(ScriptRunner):
"""

def run(self, path: str) -> None:
exit_code = subprocess.call(args=[], executable=path)
# add special known paths to the system path
new_env = os.environ.copy()
for additional_path in []:
new_env["PATH"] = f"{new_env['PATH']}:{additional_path}"
exit_code = subprocess.call(args=[], executable=path, env=new_env)
if exit_code != 0:
raise OSError("Script %s returned a non-zero exit code %s" % (path, exit_code))

Expand Down

0 comments on commit 17dabe4

Please sign in to comment.