Skip to content

Commit

Permalink
chore: add a tmux script to start the "standard" dev setup I am using
Browse files Browse the repository at this point in the history
  • Loading branch information
MangelMaxime committed Dec 16, 2024
1 parent ea1c0ce commit eecbbc6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ When using the test command, you can focus on a specific by forwarding arguments

If you need to run a local version of `@glutinum/cli`, you can use `./build.sh cli [--watch]` and then run `node cli.js <args>`.

### Tmux setup

When working on Glutinum, I often need to start both the web interface and the tests watcher.

To make it easier, I created a tmux script that starts both in a single command.

```bash
./start-dev.sh
```

> ℹ You need to have `tmux` installed.
### Debugging

If you use VSCode, you can run the build script/commands from the `JavaScript Debug Terminal`. This allows you to have access to the debugger, breakpoints, etc. (it works from the F# files too).
Expand Down
26 changes: 26 additions & 0 deletions start-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Set Session Name
SESSION="Glutinum"
SESSIONEXISTS=$(tmux list-sessions | grep $SESSION)

# Only create tmux session if it doesn't already exist
if [ "$SESSIONEXISTS" = "" ]; then
# Start New Session with our name
tmux new-session -d -s $SESSION

# Run 'echo "hello world"' in the first pane
tmux send-keys -t $SESSION "./build.sh test specs --generate-only --watch" C-m

# Split the window horizontally to create a second pane
tmux split-window -h -t $SESSION

# Run 'pwd' in the second pane
tmux send-keys -t $SESSION:0.1 "./build.sh web --watch" C-m

# Attach to the tmux session
tmux attach -t $SESSION:0.0
fi

# Attach Session, on the Main window
tmux attach-session -t $SESSION:0.0

0 comments on commit eecbbc6

Please sign in to comment.