heroku-buildpack-uml/bin/fix_procfile

18 lines
413 B
Plaintext
Raw Normal View History

2017-12-10 17:06:11 +00:00
#!/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)