mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 19:09:44 +00:00
workers as env variable
This commit is contained in:
@@ -259,3 +259,7 @@ export DOTDROP_TMPDIR="/tmp/dotdrop-tmp"
|
||||
```bash
|
||||
export DOTDROP_WORKDIR="/tmp/dotdrop-workdir"
|
||||
```
|
||||
* `DOTDROP_WORKERS`: overwrite the `-w --workers` cli argument
|
||||
```bash
|
||||
export DOTDROP_WORKERS="10"
|
||||
```
|
||||
|
||||
@@ -25,6 +25,7 @@ ENV_NOBANNER = 'DOTDROP_NOBANNER'
|
||||
ENV_DEBUG = 'DOTDROP_DEBUG'
|
||||
ENV_NODEBUG = 'DOTDROP_FORCE_NODEBUG'
|
||||
ENV_XDG = 'XDG_CONFIG_HOME'
|
||||
ENV_WORKERS = 'DOTDROP_WORKERS'
|
||||
BACKUP_SUFFIX = '.dotdropbak'
|
||||
|
||||
PROFILE = socket.gethostname()
|
||||
@@ -247,7 +248,11 @@ class Options(AttrMonitor):
|
||||
if a.kind == Action.post]
|
||||
self.install_ignore = self.instignore
|
||||
try:
|
||||
self.install_parallel = int(self.args['--workers'])
|
||||
if ENV_WORKERS in os.environ:
|
||||
workers = int(os.environ[ENV_WORKERS])
|
||||
else:
|
||||
workers = int(self.args['--workers'])
|
||||
self.install_parallel = workers
|
||||
except ValueError:
|
||||
self.log.err('bad option for --workers')
|
||||
sys.exit(USAGE)
|
||||
|
||||
Reference in New Issue
Block a user