Skip to content
Snippets Groups Projects
Commit 4b5ae6c1 authored by jurgenhaas's avatar jurgenhaas
Browse files

#31 Rename the variable for the shell configuration and document the behavior in readme

parent abed2f7e
Branches
Tags feat-mac-002
No related merge requests found
......@@ -87,6 +87,18 @@ git config --global user.email "you@example.com"
git config --global user.name "Your Name"
```
## Configuring the shell
By default, L3D tries to use the same shell inside the containers that you also use on your host. If that's not possible, it falls back to [FISH](https://fishshell.com).
If you want to overwrite the shell deliberatly, then define an environment variable on your host, like e.g.
```shell script
export L3DSHELL=/bin/bash
```
Note that only new containers will get affected by this setting.
## Getting help
Calling `l3d help` displays information about **L3D** and provides a link to further details.
......
......@@ -28,7 +28,7 @@ function startContainer {
touch ${HOMEDIR}/.gitconfig
docker run --name ${COMPOSE_PROJECT_NAME}_l3d -dt \
--hostname ${COMPOSE_PROJECT_NAME}-l3d \
--env USERSHELL=${USERSHELL} \
--env L3DSHELL=${L3DSHELL} \
--env COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME} \
--env PHP_VERSION=${PHP_VERSION} \
--env SSH_AUTH_SOCK=${SSHAUTHSOCK} \
......
#!/bin/bash
if [[ -n ${L3DSHELL} ]]; then
USERSHELL=${L3DSHELL}
elif [[ -n ${SHELL} ]]; then
USERSHELL=${SHELL}
else
USERSHELL="/usr/bin/fish"
fi
SSHAUTH=${SSH_AUTH_SOCK}
SSHAUTHSOCK=/ssh-agent
L3DHOSTOS="$(uname -s)"
......@@ -37,12 +30,19 @@ if [[ ! -n ${ID} ]]; then
--volume ${SCRIPTPATH}:/setup \
registry.lakedrops.com/docker/l3d/run:'{{ version }}'
fi
if [[ -n ${L3DSHELL} ]]; then
# Nothing to do, we go with this value
elif [[ -n ${SHELL} ]]; then
L3DSHELL=${SHELL}
else
L3DSHELL="/usr/bin/fish"
fi
if [[ -f ".env" ]]; then
export $(cat .env | xargs) > /dev/null 2>&1
fi
docker exec -it \
--env HOMEDIR=${HOME} \
--env USERSHELL=${USERSHELL} \
--env L3DSHELL=${L3DSHELL} \
--env WORKDIR=${PWD} \
--env SSHAUTH=${SSHAUTH} \
--env SSHAUTHSOCK=${SSHAUTHSOCK} \
......
......@@ -75,8 +75,8 @@ if [[ ! -n "$EXISTING" ]]; then
fi
restoreEnvFile
if [[ -x "${USERSHELL}" ]]; then
${USERSHELL}
if [[ -x "${L3DSHELL}" ]]; then
${L3DSHELL}
else
/usr/bin/fish
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment