Skip to content

Commit af021d5

Browse files
authored
Set environment variable for editor to allow gtt config to work from docker
1 parent ec5ca47 commit af021d5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

documentation.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,21 @@ you can use the official [Docker image](https://hub.docker.com/r/kriskbx/gitlab-
6969
```shell
7070
docker run \
7171
--rm -it \
72+
-e EDITOR=vi \
7273
-v ~:/root \
7374
-v $(pwd):/pwd \
7475
kriskbx/gitlab-time-tracker \
7576
--help
7677
```
7778

78-
`--rm` removes the container after running, `-it` makes it interactive, `-v ~:/root` mounts your home directory to the
79+
`--rm` removes the container after running, `-it` makes it interactive, `-e EDITOR=vi` picks `vi` as the editor inside docker to allow for `gtt config` to edit the file directly, `-v ~:/root` mounts your home directory to the
7980
home directory inside the container, `-v $(pwd):/pwd` mounts current directory inside the container to gtt be able to read local config. If you want to store the config in another place, mount another directory:
8081

8182

8283
```shell
8384
docker run \
8485
--rm -it \
86+
-e EDITOR=vi \
8587
-v /path/to/gtt-config:/root \
8688
kriskbx/gitlab-time-tracker \
8789
--help
@@ -94,6 +96,7 @@ docker volume create gtt-config
9496

9597
docker run \
9698
--rm -it \
99+
-e EDITOR=vi \
97100
-v gtt-config:/root \
98101
kriskbx/gitlab-time-tracker \
99102
--help
@@ -102,7 +105,7 @@ docker run \
102105
I highly recommend creating an alias and adding it to your `bashrc`:
103106

104107
```shell
105-
echo "alias gtt='docker run --rm -it -v ~:/root -v $(pwd):/pwd kriskbx/gitlab-time-tracker'" >>~/.bashrc
108+
echo "alias gtt='docker run --rm -it -e EDITOR=vi -v ~:/root -v $(pwd):/pwd kriskbx/gitlab-time-tracker'" >>~/.bashrc
106109
```
107110

108111
Now you can simply write `gtt` instead of the bulky Docker command before. Try it out: `gtt --help`

0 commit comments

Comments
 (0)