Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 46df744

Browse files
committed
run.sh now uses virtualenv properly
1 parent b86fbdd commit 46df744

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pyfibot/modules/module_update.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
from __future__ import unicode_literals, print_function, division
23
import subprocess
34
import sys
@@ -38,17 +39,19 @@ def command_update(bot, user, channel, args):
3839
bot.say(channel, "Errors: %s" % err)
3940

4041
# fetch new required packages if needed
41-
cmd = ['../bin/pip', 'install', '-r', '../requirements.txt']
42+
cmd = ['pip', 'install', '--upgrade', '--requirement', '../requirements.txt']
4243
log.debug("executing pip install in %s" % cwd)
4344

4445
p = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
4546
res = p.wait()
4647
out, err = p.communicate()
4748

4849
if res:
49-
bot.say(channel, "Update failed:")
50+
bot.say(channel, "Package update failed:")
5051
for line in out.split("\n"):
5152
bot.say(channel, "%s" % line)
53+
for line in err.split("\n"):
54+
bot.say(channel, "%s" % line)
5255
else:
5356
bot.say(channel, "Package status OK")
5457
pip_ok = True

run.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
if [ ! -x databases/ ]; then
33
mkdir databases
44
fi;
55

6-
bin/python pyfibot/pyfibot.py config.yml
6+
source bin/activate
7+
python pyfibot/pyfibot.py config.yml

0 commit comments

Comments
 (0)