You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Direct file replacement**: fraglet-entrypoint can now overwrite an entire target file when `injection.codePath` is provided without match markers. Enables Brainfuck-style workflows where the program is the whole file.
5
+
-**Smarter config parsing**: loader now distinguishes between line, range, and file injections instead of silently resetting `codePath`-only configs.
6
+
-**Expanded test coverage**: integration suite exercises the file replacement path and new unit tests lock the injection-mode helpers.
7
+
8
+
## ✨ New Features
9
+
10
+
### Direct File Replacement (Brainfuck-ready)
11
+
- Detects `codePath` without `match` / `match_start` / `match_end` and copies the fraglet payload directly over the destination file.
12
+
- Runs as the container user, preserving permissions and honoring `execution.makeExecutable`.
13
+
- Works seamlessly with existing `usage` / `guide` commands; usage now reports “entire file replacement” when no markers exist.
14
+
15
+
### Injection Mode Helpers
16
+
- Added `isLineInjection`, `isRangeInjection`, and `isFileInjection` helpers.
17
+
-`isEmptyInjection` now only fires when *no* injection mode is configured, preventing accidental fallbacks to defaults.
18
+
19
+
## 🔧 Configuration
20
+
21
+
### File Replacement Example (`fraglet.yaml`)
22
+
```yaml
23
+
fragletTempPath: /FRAGLET
24
+
injection:
25
+
codePath: /code/hello-world.bf # no markers → entire file is replaced
26
+
guide: /guide.md
27
+
execution:
28
+
path: /code/hello-world.bf
29
+
makeExecutable: true
30
+
```
31
+
32
+
### Line / Range Modes (unchanged)
33
+
- Still specify `match` for single-line replacement or `match_start` + `match_end` for regions.
34
+
- You can mix in a custom `codePath` with either mode.
35
+
36
+
## 🧪 Testing
37
+
- `entrypoint/tests/docker_integration`now includes **Test 3** which mounts a shebang’d fraglet, replaces `/code/hello-world-replace.sh`, and proves execution works end-to-end.
38
+
- Added `pkg/fraglet/config_test.go` to enforce the injection helper behavior.
39
+
- `make test-entrypoint`and `go test ./pkg/fraglet/...` must be green before tagging.
40
+
41
+
## 🚀 Building the Binary
42
+
```bash
43
+
cd entrypoint
44
+
GOOS=linux GOARCH=amd64 go build -o dist/linux_amd64/fraglet-entrypoint ./cmd
45
+
# Repeat for other arches as needed
46
+
```
47
+
48
+
## 🧩 Integrating with 100hellos/brainfuck
49
+
1. Copy the new `fraglet-entrypoint` binary into the image (e.g. `/usr/local/bin/fraglet-entrypoint`).
50
+
2. Add a `fraglet.yaml` like the file replacement example above.
0 commit comments