Skip to content

Commit

Permalink
Merge pull request #2786 from owid/10-17-misc-allow-tmux-shell-override
Browse files Browse the repository at this point in the history
misc-allow-tmux-shell-override
  • Loading branch information
danyx23 authored Oct 19, 2023
2 parents 5f4db6c + 2c333cf commit 8908b6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# https://unix.stackexchange.com/questions/352316/finding-out-the-default-shell-of-a-user-within-a-shell-script
LOGIN_SHELL = $(shell finger $(USER) | grep 'Shell:*' | cut -f3 -d ":")

# Check for the environment variable OWID_SCRIPT_SHELL and fall back to LOGIN_SHELL if not set
SCRIPT_SHELL ?= $(shell echo $$OWID_SCRIPT_SHELL)
SCRIPT_SHELL ?= $(LOGIN_SHELL)

# setting .env variables as Make variables for validate.env targets
# https://lithic.tech/blog/2020-05/makefile-dot-env/
ifneq (,$(wildcard ./.env))
Expand Down Expand Up @@ -53,7 +57,7 @@ up: require create-if-missing.env tmp-downloads/owid_metadata.sql.gz
tmux new-session -s grapher \
-n docker 'docker-compose -f docker-compose.grapher.yml up' \; \
set remain-on-exit on \; \
set-option -g default-shell $(LOGIN_SHELL) \; \
set-option -g default-shell $(SCRIPT_SHELL) \; \
new-window -n admin \
'devTools/docker/wait-for-mysql.sh && yarn run tsc-watch -b --onSuccess "yarn startAdminServer"' \; \
set remain-on-exit on \; \
Expand Down Expand Up @@ -106,7 +110,7 @@ up.full: require create-if-missing.env.full wordpress/.env tmp-downloads/owid_me
tmux new-session -s grapher \
-n docker 'docker-compose -f docker-compose.full.yml up' \; \
set remain-on-exit on \; \
set-option -g default-shell $(LOGIN_SHELL) \; \
set-option -g default-shell $(SCRIPT_SHELL) \; \
new-window -n admin \
'devTools/docker/wait-for-mysql.sh && yarn run tsc-watch -b --onSuccess "yarn startAdminServer"' \; \
set remain-on-exit on \; \
Expand Down

0 comments on commit 8908b6d

Please sign in to comment.