diff --git a/github_deploy/main.py b/github_deploy/main.py index bec9463..2acef84 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -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(