heroku-buildpack-uml/bin/fix_procfile

18 lines
414 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)
2017-12-13 17:51:09 +00:00
lines.append(type+': /app/.uml/uml_run '+shlex.quote('cd /app; '+cmd.strip())+'\n')
2017-12-10 17:06:11 +00:00
else:
lines.append(line)
with open(procfile_path, 'w') as file:
file.writelines(lines)