diff --git a/Makefile b/Makefile index 1bf321e..52a8b92 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +host_deps: + ./m host_deps + python_clean: rm -fr \ ~/.local/bin/env3 \ diff --git a/_m.py b/_m.py index e732d7d..46c0766 100644 --- a/_m.py +++ b/_m.py @@ -259,9 +259,17 @@ def inside_env() -> bool: # ruff = 'ruff' # m2 = 'm2' -Command_args = ['js', 'mypy', 'env', 'ruff', 'm2'] +def host_deps(argv: list[str]) -> None: + if sys.platform in ['linux']: + subprocess.check_call(r''' + exec yay -S $(cat requirements-archlinux.txt) + ''', shell=True,) + else: + raise NotImplementedError -Command : TypeAlias = Literal['js', 'mypy', 'env', 'ruff', 'm2'] +Command_args = ['js', 'mypy', 'env', 'ruff', 'm2', 'host_deps',] + +Command : TypeAlias = Literal['js', 'mypy', 'env', 'ruff', 'm2', 'host_deps',] def run(argv: Optional[list[str]] = None) -> None: logging.basicConfig( @@ -297,6 +305,8 @@ def run(argv: Optional[list[str]] = None) -> None: if options.command == 'js': js(args) + elif options.command == 'host_deps': + host_deps(args) elif options.command == 'env': env(args) elif options.command == 'mypy': @@ -316,4 +326,4 @@ def run(argv: Optional[list[str]] = None) -> None: raise NotImplementedError if __name__ == '__main__': - run(sys.argv[1:]) + run(sys.argv[1:]) \ No newline at end of file diff --git a/requirements-archlinux.txt b/requirements-archlinux.txt new file mode 100644 index 0000000..162b1f7 --- /dev/null +++ b/requirements-archlinux.txt @@ -0,0 +1 @@ +python-build