make run_locally work with --dry-run

Hi all,

This pull request just make the `run_locally` function work with the `--dry-run` flag.