From 1856ea02e6c6a0f4952762f08e90dd925b5cb290 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Mon, 9 May 2016 21:22:39 +0200 Subject: [PATCH] support full script paths --- .gitignore | 3 +++ exec.py | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d3c4e47 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc +/tmp/ +/config.py diff --git a/exec.py b/exec.py index c7277ba..207a4f9 100644 --- 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 -- 2.30.2