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

Commit

Permalink
run.sh now uses virtualenv properly
Browse files Browse the repository at this point in the history
  • Loading branch information
lepinkainen committed Mar 2, 2016
1 parent b86fbdd commit 46df744
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pyfibot/modules/module_update.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

from __future__ import unicode_literals, print_function, division
import subprocess
import sys
Expand Down Expand Up @@ -38,17 +39,19 @@ def command_update(bot, user, channel, args):
bot.say(channel, "Errors: %s" % err)

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

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

if res:
bot.say(channel, "Update failed:")
bot.say(channel, "Package update failed:")
for line in out.split("\n"):
bot.say(channel, "%s" % line)
for line in err.split("\n"):
bot.say(channel, "%s" % line)
else:
bot.say(channel, "Package status OK")
pip_ok = True
Expand Down
5 changes: 3 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
#!/bin/bash
if [ ! -x databases/ ]; then
mkdir databases
fi;

bin/python pyfibot/pyfibot.py config.yml
source bin/activate
python pyfibot/pyfibot.py config.yml

0 comments on commit 46df744

Please sign in to comment.