Skip to content

Commit e0ffdaf

Browse files
committed
8======D ~ ~ ~ 0.3.1 ~ ~
1 parent 014f130 commit e0ffdaf

7 files changed

Lines changed: 72 additions & 42 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release tvmux
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*' # Trigger on any semantic version tag (e.g. 0.3.1)
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Build script
16+
run: make build
17+
18+
- name: Create Release
19+
id: create_release
20+
uses: softprops/action-gh-release@v1
21+
with:
22+
name: tvmux ${{ github.ref_name }}
23+
body_path: README.md
24+
files: build/tvmux
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

β€ŽMakefileβ€Ž

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
.PHONY: start stop clean test
1+
.PHONY: start stop clean test build install
22

3-
CACHE_DIR := .cache
4-
SCRIPT := ./tmux_monitor.sh
3+
NAME := tvmux
4+
SCRIPT := ./$(NAME).sh
5+
BUILT_SCRIPT := build/$(NAME)
6+
PREFIX ?= $(HOME)/.local
57

68
# Find all test files
9+
CACHE_DIR := .cache
710
TEST_FILES := $(wildcard tests/test_*.sh)
811

912
start:
@@ -18,9 +21,29 @@ status:
1821
@$(SCRIPT) status
1922

2023
clean:
21-
@rm -rf $(CACHE_DIR) current.cast
22-
@echo "Cleaned cache and symlink"
24+
@rm -rf $(CACHE_DIR) current.cast $(BUILT_SCRIPT)
2325

2426
# Test target depends on all test files and the runner script
2527
test: $(TEST_FILES) tests/run_all.sh
2628
@tests/run_all.sh
29+
30+
# Build target - concatenate all sources into a single script
31+
build: $(BUILT_SCRIPT)
32+
install: $(PREFIX)/bin/$(NAME)
33+
34+
$(BUILT_SCRIPT): $(SCRIPT) lib/*.sh
35+
@echo "Building $(NAME)..."
36+
@mkdir -p build
37+
@# Use bash debug tracing to output everything, then filter out shebangs and source lines
38+
@echo "#!/bin/bash" > $(BUILT_SCRIPT)
39+
@echo "" >> $(BUILT_SCRIPT)
40+
@PS4="8======D ~ ~ ~ ~" bash -xv -c 'source $(SCRIPT)' 2>&1 | \
41+
grep -v "8======D ~ ~ ~ ~" | grep -Ev '^(#|source )' >> $(BUILT_SCRIPT)
42+
@chmod +x $(BUILT_SCRIPT)
43+
@echo "Built $(BUILT_SCRIPT)"
44+
45+
$(PREFIX)/bin/$(NAME): $(BUILT_SCRIPT)
46+
@echo "Installing $(NAME) to $(PREFIX)/bin"
47+
@mkdir -p $(PREFIX)/bin
48+
@install -m 755 $(BUILT_SCRIPT) $(PREFIX)/bin/$(NAME)
49+
@echo "Installed to $(PREFIX)/bin/$(NAME)"

β€ŽREADME.mdβ€Ž

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
1-
# πŸ€– monitor
1+
# πŸ“Ί `tvmux`
22

33
So I want to capture my dev work in tmux so I can train models on how to program
44
and actually use a computer. More data is good.
55

66
This is my current tmux setup, including my `tmux.conf`.
77

8-
## `0.3.0`
8+
## `0.3.1`
99

1010
This shell script records a session following the active pane. After some turd
1111
polish and more testing, I plan to expand it to work with one window per
12-
project and separate recordings for each. I'll likely split it up into a library
13-
of bash scripts that are concatenated on deployment, like I have in
14-
[πŸ”— rip](https://github.com/bitplane/rip).
15-
16-
From 0.3 onwards, with each stable period I'll tag it as a "release" even though
17-
it's not really a release.
12+
project, quantizing recordings, asciinema streaming etc etc
1813

1914
## To-do
2015

2116
### General
2217

23-
- [ ] get the monitor panel working so i don't need to manually create it each
18+
- [ ] get the monitor panel working so I don't need to manually create it each
2419
reboot.
25-
- [ ] Write a `./configure` script that checks all the things we need.
26-
- [ ] `make build` and `make install` to `$PREFIX`, defaulting to `~/.local/`
20+
- [x] Write a `./configure` script that checks all the things we need.
21+
- [x] `make build` and `make install` to `$PREFIX`, defaulting to `~/.local/`
2722

2823
### `0.4`
2924

3025
- [ ] Record everything and selectively switch between buffers
3126
- [ ] timestamp logs with an awk script
3227
- [ ] Get alternative buffers working
33-
- [ ] Break stuff into a library?
28+
- [x] Break stuff into a library + pack it
29+
- [ ] quantize because spinners are a menace
30+
- thought: set a cps limit and send full buffers if exceeded
3431

35-
### `0.5`
32+
### `__future__`
3633

3734
- [ ] Command line args / flags / config
3835
- [ ] Consider a generic settings approach that works with config file, args
3936
and env vars as first class citizens.
40-
- [ ] Consider different entrypoints.
41-
- [ ] Review breaking down into functions like in `rip`
37+
- [ ] Move deployment/install code into the script itself
38+
- [ ] Put markers in so it can unpack itself to source 😎
39+
- [ ] Think about how to pack docs, unpacking full source with makefile and
40+
`README.md`? 🀯

β€Žpanel/gpu.shβ€Ž

Lines changed: 0 additions & 2 deletions
This file was deleted.

β€Žpanel/uptime.shβ€Ž

Lines changed: 0 additions & 12 deletions
This file was deleted.

β€Žplan.mdβ€Ž

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ handle_stop() {
8888
log_info "Recording stopped: $session_dir"
8989
}
9090

91-
# Dispatch commands
92-
cmd_dispatch "$@"
91+
# Only dispatch commands if this script is being run directly
92+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
93+
cmd_dispatch "$@"
94+
fi

0 commit comments

Comments
Β (0)