From 57b03d6493f723c29bd142a0f1d73d6298e97439 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Tue, 3 Feb 2026 13:05:48 +0200 Subject: [PATCH] build: update creat-app task --- Makefile | 30 +++++++++++++++++++++++++++++- README.md | 19 ++++++++++--------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index deec002..2702df0 100644 --- a/Makefile +++ b/Makefile @@ -74,4 +74,32 @@ create-app: HOMEBREW_EDITOR=cat brew create --tap chenasraf/tap --set-name "$$REPO_NAME" "$$URL"; \ echo "Created Formula/$$REPO_NAME.rb"; \ echo "Version: $$VERSION"; \ - echo "URL: $$URL" + echo "URL: $$URL"; \ + echo ""; \ + echo "Please edit Formula/$$REPO_NAME.rb and press Enter when done..."; \ + read -r _; \ + BRANCH="feature/$$REPO_NAME-$$VERSION"; \ + if ! git switch -C "$$BRANCH"; then \ + echo "Branch already exists, aborting"; \ + exit 1; \ + fi; \ + git add "Formula/$$REPO_NAME.rb"; \ + git commit -m "feat: add $$REPO_NAME $$VERSION"; \ + git push --force --set-upstream origin "$$BRANCH"; \ + if [ -n "$$PR_BODY" ]; then \ + printf '%s\n' "$$PR_BODY" > /tmp/pr_body.md; \ + gh pr create --fill --body-file /tmp/pr_body.md; \ + PR_EXIT=$$?; \ + rm -f /tmp/pr_body.md; \ + else \ + gh pr create --fill; \ + PR_EXIT=$$?; \ + fi; \ + if [ $$PR_EXIT -eq 0 ]; then \ + URL=$$(gh pr list --json url | jq -r '.[0].url'); \ + open "$$URL"; \ + git switch master; \ + else \ + echo "Couldn't create PR, aborting"; \ + exit 1; \ + fi diff --git a/README.md b/README.md index ba9a31a..07c2b96 100644 --- a/README.md +++ b/README.md @@ -32,15 +32,16 @@ brew "" ## Available Formulae -| Name | Description | -| ------------------------------------------------------------- | --------------------------------------------------------- | -| [direnv-dotenvx](https://github.com/chenasraf/direnv-dotenvx) | Direnv plugin to load .env files using dotenvx | -| [gi_gen](https://github.com/chenasraf/gi_gen) | Gitignore generator for any type of project | -| [sofmani](https://github.com/chenasraf/sofmani) | Installs software from a declerative config on any system | -| [treelike](https://github.com/chenasraf/treelike) | Outputs a Tree-like representation from strings | -| [tx](https://github.com/chenasraf/tx) | Tmux session manager | -| [vstask](https://github.com/chenasraf/vstask) | Run VS Code tasks.json from the terminal | -| [watchr](https://github.com/chenasraf/watchr) | Terminal UI for running and watching command output | +| Name | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------------------- | +| [direnv-dotenvx](https://github.com/chenasraf/direnv-dotenvx) | Direnv plugin to load .env files using dotenvx | +| [gi_gen](https://github.com/chenasraf/gi_gen) | Gitignore generator for any type of project | +| [sofmani](https://github.com/chenasraf/sofmani) | Installs software from a declerative config on any system | +| [treelike](https://github.com/chenasraf/treelike) | Outputs a Tree-like representation from strings | +| [tx](https://github.com/chenasraf/tx) | Tmux session manager | +| [vstask](https://github.com/chenasraf/vstask) | Run VS Code tasks.json from the terminal | +| [watchr](https://github.com/chenasraf/watchr) | Terminal UI for running and watching command output | +| [cospend-cli](https://github.com/chenasraf/cospend-cli) | Command-line interface for adding expenses to Nextcloud Cospend projects. | ## Documentation