'Generate a dev_run.sh script for running deck locally.
Args:
repository [string]: The name of the local repository to generate in.'

def write_deck_run_script(self, repository):

    name = repository.name
    path = '{name}/start_dev.sh'.format(name=name)
    with open(path, 'w') as f:
        f.write('#!/bin/bash\nd=$(dirname    "$0")\ncd    "$d"\nLOG_DIR=${{LOG_DIR:-../logs}}\n\nnpm    install    >&    "$LOG_DIR/{name}.log"\nbash    -c    "(./start.sh    >>    \'$LOG_DIR/{name}.log\')    2>&1    |    tee    -a    \'$LOG_DIR/{name}.log\'    >&    \'$LOG_DIR/{name}.err\'    &"\n'.format(name=name))
    os.chmod(path, 511)
