Skip to content

Commit 29310f0

Browse files
committed
pip install now checks for requirements.txt first
1 parent 7dd0ddf commit 29310f0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

config/config.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
project. Alternatively, select "none" if you are going to test using
1010
some other plugin.
1111
</p>
12+
<button class="btn btn-primary" ng-click="save()">Save</button>

worker.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
var path = require('path')
2+
, fs = require('fs')
23

34
module.exports = {
45
init: function (config, job, context, done) {
5-
var venvDir = path.join(context.dataDir, '.venv')
6+
var venvDir = path.join(context.baseDir, '.venv')
67
done(null, {
78
path: [path.join(__dirname, 'thirdparty'),
89
path.join(venvDir, 'bin')],
910
environment: 'virtualenv.py ' + venvDir,
10-
prepare: 'pip install -r requirements.txt',
11+
prepare: function (context, done) {
12+
if (fs.existsSync(path.join(context.dataDir, 'requirements.txt'))) {
13+
return context.cmd('pip install -r requirements.txt', function (err) {
14+
done(err, true)
15+
})
16+
}
17+
done(null, false)
18+
},
1119
test: config.test !== 'none' ? config.test : undefined
1220
})
1321
},

0 commit comments

Comments
 (0)