heroku-buildpack-uml/bin/fix_procfile

18 lines
413 B
Python
Executable File

#!/usr/bin/env python3
import sys, shlex
procfile_path = sys.argv[1]
lines = []
with open(procfile_path) as file:
for line in file:
if ":" in line:
type, cmd = line.split(':', 1)
lines.append(type+': /app/uml/uml_run '+shlex.quote('cd /app; '+cmd.strip())+'\n')
else:
lines.append(line)
with open(procfile_path, 'w') as file:
file.writelines(lines)