support full script paths
authorChristian Weiske <cweiske@cweiske.de>
Mon, 9 May 2016 19:22:39 +0000 (21:22 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 9 May 2016 19:22:39 +0000 (21:22 +0200)
.gitignore [new file with mode: 0644]
exec.py

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..d3c4e47
--- /dev/null
@@ -0,0 +1,3 @@
+*.pyc
+/tmp/
+/config.py
diff --git a/exec.py b/exec.py
index c7277ba..207a4f9 100644 (file)
--- a/exec.py
+++ b/exec.py
@@ -1,7 +1,5 @@
 # -*- coding: utf-8 -*-
-import os
-import re
-import subprocess
+import os, re, subprocess
 from errbot import BotPlugin, botcmd, re_botcmd
 from errbot.utils import ValidationException
 
@@ -30,6 +28,9 @@ class Exec(BotPlugin):
         if len(name) == 0:
             raise ValidationException('Command is empty')
 
+        if os.path.exists(name):
+            return
+
         found = False
         for path in os.environ['PATH'].split(os.pathsep):
             fullpath = path + os.sep + name