Skip to content
Snippets Groups Projects
Commit a25dbfc2 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

setup-base-dir: add a shorthand to execute shell command

parent 3646474f
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import os
import stat
import sys
import subprocess
from pathlib import Path
......@@ -40,6 +41,13 @@
subprocess.run(command, check=True)
BASH_PROXY = """#!/bin/bash
set -euo pipefail
. `dirname $0`/activate
"$@"
"""
def setup_quick_access():
Path("bin").mkdir(parents=True)
......@@ -48,6 +56,10 @@
os.symlink(env_bin / "poulpe", dir_bin / "poulpe")
os.symlink(env_bin / "activate", dir_bin / "activate")
bash_proxy = dir_bin / "shell"
bash_proxy.write_text(BASH_PROXY)
bash_proxy.chmod(bash_proxy.stat().st_mode | stat.S_IEXEC)
def setup_base_dir(path):
base_path = Path(path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment