Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions github_deploy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ def list_commands(self, ctx):
def get_command(self, ctx, name):
ns = {}
fn = os.path.join(plugin_folder, name + '.py')
with open(fn) as f:
code = compile(f.read(), fn, 'exec')
eval(code, ns, ns)
return ns['main']

if os.path.exists(fn):
with open(fn) as f:
code = compile(f.read(), fn, 'exec')
eval(code, ns, ns)
return ns['main']

ctx.fail("Invalid Command: {name}".format(name=name))


main = GithubDeploy(
Expand Down