Compare commits
No commits in common. "25353f548dca5e8aa0d8470b2345c22b3028bab0" and "3d73e02d6b07e94f3911749485dc43d6cabb1f46" have entirely different histories.
25353f548d
...
3d73e02d6b
4 changed files with 13 additions and 49 deletions
|
|
@ -26,30 +26,13 @@ PR contract in `upstream-prs/`. See the lnbits-sensei README's
|
||||||
|
|
||||||
## Quick commands
|
## Quick commands
|
||||||
|
|
||||||
Installed by lnbits-sensei's dev-env module — standalone binaries plus
|
- `dev up [--fakewallet|--regtest]` — start the lnbits dev server.
|
||||||
shell functions sourced into interactive shells:
|
Default `--fakewallet` is instant, no docker, good for
|
||||||
|
extension/UI/API work.
|
||||||
- `dev-env-bootstrap` — materialize bare repos + worktrees from your
|
- `dev down` / `dev logs` / `dev shell` — control / inspect.
|
||||||
declared `projects` (idempotent; `--dry-run` to preview).
|
- *(planned)* `prb <repo> <branch>` — create a PR worktree branched
|
||||||
- `lb <worktree>` — cd into `~/dev/lnbits/<worktree>` (e.g. `lb dev`).
|
from `upstream/main` under `~/dev/upstream-prs/`.
|
||||||
`g <category> <repo>`, `ext <name>`, `prs`, `shared`, `repos` cover
|
- *(planned)* `lb <worktree>` — cd shortcut into `~/dev/lnbits/<worktree>`.
|
||||||
the rest of the tree.
|
|
||||||
- `prb <repo> <branch>` — create a PR worktree branched from
|
|
||||||
`upstream/main` under `~/dev/upstream-prs/`; `prc` cleans up, `prl`
|
|
||||||
lists.
|
|
||||||
- `dev-status` — dirty + ahead/behind across every worktree. `wts` /
|
|
||||||
`wtu` sync worktrees / fetch upstream; `rebase status` shows which
|
|
||||||
forks need rebasing onto upstream.
|
|
||||||
- `regtest-start <worktree>` / `regtest-stop` — Bitcoin/Lightning
|
|
||||||
regtest stack (only when `devEnv.regtest.enable = true`; needs docker).
|
|
||||||
- `dev-deploy <host>` — `nixos-rebuild` against your deploy flake.
|
|
||||||
`dev-tm <session>` — launch a declarative tmux session.
|
|
||||||
|
|
||||||
**Starting lnbits for iteration:** there is no `dev up` wrapper.
|
|
||||||
FakeWallet (`LNBITS_BACKEND_WALLET_CLASS=FakeWallet`) is the default
|
|
||||||
path — no docker; run lnbits directly from the worktree (`lb dev`, then
|
|
||||||
lnbits's own run command). Use `regtest-start` only when you need real
|
|
||||||
channels/payments.
|
|
||||||
|
|
||||||
## Reference docs
|
## Reference docs
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,19 +70,9 @@ Full reference: `docs/lnbits-upstream-flow.md`.
|
||||||
|
|
||||||
## Default dev workflow
|
## Default dev workflow
|
||||||
|
|
||||||
There is no `dev up` wrapper. Start lnbits directly from a worktree:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
lb dev # cd ~/dev/lnbits/dev
|
dev up # FakeWallet, instant
|
||||||
LNBITS_BACKEND_WALLET_CLASS=FakeWallet <lnbits run command> # instant, no docker
|
dev up --regtest # multi-node regtest (slower boot, real channels)
|
||||||
```
|
|
||||||
|
|
||||||
For real channels/payments, use the regtest stack (gated on
|
|
||||||
`devEnv.regtest.enable`; needs docker):
|
|
||||||
|
|
||||||
```
|
|
||||||
regtest-start dev # build lnbits from ~/dev/lnbits/dev, bring the stack up
|
|
||||||
regtest-stop
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use **FakeWallet** for extension CRUD / UI / API work. Spin up
|
Use **FakeWallet** for extension CRUD / UI / API work. Spin up
|
||||||
|
|
|
||||||
|
|
@ -113,17 +113,8 @@ git-pr-cleanup() {
|
||||||
git -C "$bare_repo" worktree remove "$pr_path"
|
git -C "$bare_repo" worktree remove "$pr_path"
|
||||||
|
|
||||||
echo "Deleting branch: $branch_name"
|
echo "Deleting branch: $branch_name"
|
||||||
if ! git -C "$bare_repo" branch -d "$branch_name" 2>/dev/null; then
|
git -C "$bare_repo" branch -d "$branch_name" 2>/dev/null \
|
||||||
echo " Branch '$branch_name' is not fully merged."
|
|| git -C "$bare_repo" branch -D "$branch_name"
|
||||||
read -r -p " Force-delete it (unmerged commits will be lost)? [y/N] " -n 1 REPLY
|
|
||||||
echo
|
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
||||||
git -C "$bare_repo" branch -D "$branch_name"
|
|
||||||
else
|
|
||||||
echo " Kept branch '$branch_name' (worktree already removed)."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ cleanup_backups() {
|
||||||
local deleted=0
|
local deleted=0
|
||||||
while IFS=: read -r path _; do
|
while IFS=: read -r path _; do
|
||||||
cd "$path" || continue
|
cd "$path" || continue
|
||||||
while read -r branch; do
|
git branch --list "backup/*" 2>/dev/null | while read -r branch; do
|
||||||
branch="$(echo "$branch" | tr -d ' *')"
|
branch="$(echo "$branch" | tr -d ' *')"
|
||||||
local bdate
|
local bdate
|
||||||
bdate="$(echo "$branch" | grep -oE '[0-9]{8}' | head -1)"
|
bdate="$(echo "$branch" | grep -oE '[0-9]{8}' | head -1)"
|
||||||
|
|
@ -319,7 +319,7 @@ cleanup_backups() {
|
||||||
|| { [[ -n "$bdate" ]] && [[ "$bdate" < "$cutoff" ]]; }; then
|
|| { [[ -n "$bdate" ]] && [[ "$bdate" < "$cutoff" ]]; }; then
|
||||||
git branch -D "$branch" 2>/dev/null && deleted=$((deleted + 1)) || true
|
git branch -D "$branch" 2>/dev/null && deleted=$((deleted + 1)) || true
|
||||||
fi
|
fi
|
||||||
done < <(git branch --list "backup/*" 2>/dev/null)
|
done
|
||||||
done < <(find_forked_repos)
|
done < <(find_forked_repos)
|
||||||
success "Deleted $deleted backup branch(es)."
|
success "Deleted $deleted backup branch(es)."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue