mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 01:34:42 +00:00
workdir env variable
This commit is contained in:
@@ -255,3 +255,7 @@ export DOTDROP_FORCE_NODEBUG=
|
||||
```bash
|
||||
export DOTDROP_TMPDIR="/tmp/dotdrop-tmp"
|
||||
```
|
||||
* `DOTDROP_WORKDIR`: overwrite the `workdir` defined in the config
|
||||
```bash
|
||||
export DOTDROP_WORKDIR="/tmp/dotdrop-workdir"
|
||||
```
|
||||
|
||||
@@ -5,11 +5,16 @@ Copyright (c) 2019, deadc0de6
|
||||
settings block
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
# local imports
|
||||
from dotdrop.linktypes import LinkTypes
|
||||
from dotdrop.dictparser import DictParser
|
||||
|
||||
|
||||
ENV_WORKDIR = 'DOTDROP_WORKDIR'
|
||||
|
||||
|
||||
class Settings(DictParser):
|
||||
# key in yaml file
|
||||
key_yaml = 'config'
|
||||
@@ -68,6 +73,8 @@ class Settings(DictParser):
|
||||
self.cmpignore = cmpignore
|
||||
self.instignore = instignore
|
||||
self.workdir = workdir
|
||||
if ENV_WORKDIR in os.environ:
|
||||
self.workdir = os.environ[ENV_WORKDIR]
|
||||
self.link_dotfile_default = LinkTypes.get(link_dotfile_default)
|
||||
self.link_on_import = LinkTypes.get(link_on_import)
|
||||
self.minversion = minversion
|
||||
|
||||
@@ -45,6 +45,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)"
|
||||
################################################################
|
||||
# this is the test
|
||||
################################################################
|
||||
unset DOTDROP_WORKDIR
|
||||
string="blabla"
|
||||
|
||||
# the dotfile source
|
||||
|
||||
Reference in New Issue
Block a user