mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 16:45:16 +00:00
workdir env variable
This commit is contained in:
@@ -255,3 +255,7 @@ export DOTDROP_FORCE_NODEBUG=
|
|||||||
```bash
|
```bash
|
||||||
export DOTDROP_TMPDIR="/tmp/dotdrop-tmp"
|
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
|
settings block
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from dotdrop.linktypes import LinkTypes
|
from dotdrop.linktypes import LinkTypes
|
||||||
from dotdrop.dictparser import DictParser
|
from dotdrop.dictparser import DictParser
|
||||||
|
|
||||||
|
|
||||||
|
ENV_WORKDIR = 'DOTDROP_WORKDIR'
|
||||||
|
|
||||||
|
|
||||||
class Settings(DictParser):
|
class Settings(DictParser):
|
||||||
# key in yaml file
|
# key in yaml file
|
||||||
key_yaml = 'config'
|
key_yaml = 'config'
|
||||||
@@ -68,6 +73,8 @@ class Settings(DictParser):
|
|||||||
self.cmpignore = cmpignore
|
self.cmpignore = cmpignore
|
||||||
self.instignore = instignore
|
self.instignore = instignore
|
||||||
self.workdir = workdir
|
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_dotfile_default = LinkTypes.get(link_dotfile_default)
|
||||||
self.link_on_import = LinkTypes.get(link_on_import)
|
self.link_on_import = LinkTypes.get(link_on_import)
|
||||||
self.minversion = minversion
|
self.minversion = minversion
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename $BASH_SOURCE) <==$(tput sgr0)"
|
|||||||
################################################################
|
################################################################
|
||||||
# this is the test
|
# this is the test
|
||||||
################################################################
|
################################################################
|
||||||
|
unset DOTDROP_WORKDIR
|
||||||
string="blabla"
|
string="blabla"
|
||||||
|
|
||||||
# the dotfile source
|
# the dotfile source
|
||||||
|
|||||||
1
tests.sh
1
tests.sh
@@ -50,6 +50,7 @@ export DOTDROP_DEBUG=yes
|
|||||||
unset DOTDROP_FORCE_NODEBUG
|
unset DOTDROP_FORCE_NODEBUG
|
||||||
# do not print debugs when running tests (faster)
|
# do not print debugs when running tests (faster)
|
||||||
#export DOTDROP_FORCE_NODEBUG=yes
|
#export DOTDROP_FORCE_NODEBUG=yes
|
||||||
|
export DOTDROP_WORKDIR=/tmp/dotdrop-tests-workdir
|
||||||
|
|
||||||
## execute bash script tests
|
## execute bash script tests
|
||||||
[ "$1" = '--python-only' ] || {
|
[ "$1" = '--python-only' ] || {
|
||||||
|
|||||||
Reference in New Issue
Block a user