From f45b0b1b9895e5afda6ec3da3096f072a58ea5ff Mon Sep 17 00:00:00 2001 From: Lars Yencken Date: Fri, 2 Aug 2024 11:23:39 +0100 Subject: [PATCH] Fix tmux session handling in Makefile Fixes #3840 Modify the `Makefile` to check for an existing tmux session named `grapher` and resume it if it exists, during `make up` or `make up.full`. --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0b10cace74f..51ecdde00c2 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,12 @@ up: export DEBUG = 'knex:query' up: require create-if-missing.env ../owid-content tmp-downloads/owid_metadata.sql.gz node_modules @make validate.env @make check-port-3306 + + @if tmux has-session -t grapher 2>/dev/null; then \ + echo '==> Killing existing tmux session'; \ + tmux kill-session -t grapher; \ + fi + @echo '==> Building grapher' yarn lerna run build @@ -97,6 +103,11 @@ up.full: require create-if-missing.env.full ../owid-content tmp-downloads/owid_m @make validate.env.full @make check-port-3306 + @if tmux has-session -t grapher 2>/dev/null; then \ + echo '==> Killing existing tmux session'; \ + tmux kill-session -t grapher; \ + fi + @echo '==> Building grapher' yarn lerna run build @@ -299,4 +310,4 @@ local-bake: itsJustJavascript yarn buildLocalBake clean: - rm -rf node_modules itsJustJavascript \ No newline at end of file + rm -rf node_modules itsJustJavascript