mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-10 16:49:17 +00:00
workers as env variable
This commit is contained in:
@@ -259,3 +259,7 @@ export DOTDROP_TMPDIR="/tmp/dotdrop-tmp"
|
|||||||
```bash
|
```bash
|
||||||
export DOTDROP_WORKDIR="/tmp/dotdrop-workdir"
|
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_DEBUG = 'DOTDROP_DEBUG'
|
||||||
ENV_NODEBUG = 'DOTDROP_FORCE_NODEBUG'
|
ENV_NODEBUG = 'DOTDROP_FORCE_NODEBUG'
|
||||||
ENV_XDG = 'XDG_CONFIG_HOME'
|
ENV_XDG = 'XDG_CONFIG_HOME'
|
||||||
|
ENV_WORKERS = 'DOTDROP_WORKERS'
|
||||||
BACKUP_SUFFIX = '.dotdropbak'
|
BACKUP_SUFFIX = '.dotdropbak'
|
||||||
|
|
||||||
PROFILE = socket.gethostname()
|
PROFILE = socket.gethostname()
|
||||||
@@ -247,7 +248,11 @@ class Options(AttrMonitor):
|
|||||||
if a.kind == Action.post]
|
if a.kind == Action.post]
|
||||||
self.install_ignore = self.instignore
|
self.install_ignore = self.instignore
|
||||||
try:
|
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:
|
except ValueError:
|
||||||
self.log.err('bad option for --workers')
|
self.log.err('bad option for --workers')
|
||||||
sys.exit(USAGE)
|
sys.exit(USAGE)
|
||||||
|
|||||||
Reference in New Issue
Block a user