forked from nat/natalieee.net
12 lines
451 B
Python
12 lines
451 B
Python
def _execute_bash(*args):
|
|
from re import sub
|
|
from os import environ as hy_env
|
|
from subprocess import check_output
|
|
env = hy_env
|
|
env['PATH'] = hy_env['PATH'] + ':./scripts'
|
|
path = args[0]
|
|
with open(path, 'r') as fp:
|
|
_hy_anon_var_1 = fp.read()
|
|
print(sub('\\$\\[(.*?)\\]', lambda sequence: check_output(sequence.group(1), shell=True, executable='/bin/bash', env=env).decode().strip(), _hy_anon_var_1))
|
|
return 0
|