allow customizing the directory plugins are installed to, move default out of src

This commit is contained in:
spalger 2015-07-15 22:27:15 -07:00
parent a3e93ee4a3
commit d21490c639
4 changed files with 8 additions and 8 deletions

2
.gitignore vendored
View file

@ -12,4 +12,4 @@ target
*.log
esvm
.htpasswd
src/server/bin/plugins
installed_plugins

View file

@ -40,7 +40,7 @@ module.exports = function (program) {
.option(
'-d, --plugin-dir <path>',
'The path to the directory where plugins are stored',
fromRoot('plugins')
fromRoot('installed_plugins')
)
.description(
'Maintain Plugins',

View file

@ -1,4 +1,4 @@
var path = require('path');
var resolve = require('path').resolve;
var expiry = require('expiry-js');
module.exports = function (options) {
@ -38,8 +38,6 @@ module.exports = function (options) {
urls: []
};
settings.workingPath = path.resolve(__dirname, '..', 'plugins', '.plugin.installing');
if (options.timeout) {
settings.timeout = options.timeout;
}
@ -94,8 +92,10 @@ module.exports = function (options) {
throw new Error('Please specify either --install or --remove.');
}
settings.pluginDir = options.pluginDir;
if (settings.package) {
settings.pluginPath = path.resolve(__dirname, '..', 'plugins', settings.package);
settings.pluginPath = resolve(settings.pluginDir, settings.package);
settings.workingPath = resolve(settings.pluginDir, '.plugin.installing');
}
return settings;
@ -105,4 +105,4 @@ module.exports = function (options) {
parse: parse,
parseMilliseconds: parseMilliseconds
};
};
};

View file

@ -39,7 +39,7 @@ module.exports = function (program) {
'times to specify multiple directories',
pluginDirCollector,
[
fromRoot('plugins'),
fromRoot('installed_plugins'),
fromRoot('src/plugins')
]
)