aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-04-21 09:54:03 -0700
committerGravatar Tom Willemse2026-04-21 09:54:03 -0700
commit22b1cf4e6328a486befe05f957508aa1e07087a0 (patch)
tree0fdddfce922f8de703e588ca636423d4a2b5dc2f
parentb83a23d2c3c369ed135b9c6ce818f7e7eb0ad8e7 (diff)
downloadnew-dotfiles-22b1cf4e6328a486befe05f957508aa1e07087a0.tar.gz
new-dotfiles-22b1cf4e6328a486befe05f957508aa1e07087a0.zip
pop-os/emacs: Add command to create a saloon connector
-rw-r--r--oni/home/config/pop-os/emacs.el33
1 files changed, 21 insertions, 12 deletions
diff --git a/oni/home/config/pop-os/emacs.el b/oni/home/config/pop-os/emacs.el
index 447fa78..ab1f0ce 100644
--- a/oni/home/config/pop-os/emacs.el
+++ b/oni/home/config/pop-os/emacs.el
@@ -40,18 +40,12 @@
(transient-define-prefix artisan-transient ()
"A transient to run artisan commands."
- ["Punt"
- ["Composer"
- ("pci" "Install" artisan-punt-composer-install)]
- ["Artisan"
- ("pac" "Run Command" artisan-punt-run-command)
- ("pam" "Migrate" artisan-punt-migrate)]]
- ["Chanced"
- ["Composer"
- ("cci" "Install" artisan-chanced-composer-install)]
- ["Artisan"
- ("cac" "Run Command" artisan-chanced-run-command)
- ("cam" "Migrate" artisan-chanced-migrate)]]
+ ["Composer"
+ ("ci" "Install" artisan-chanced-composer-install)]
+ ["Artisan"
+ ("ac" "Run Command" artisan-chanced-run-command)
+ ("am" "Migrate" artisan-chanced-migrate)
+ ("asc" "Create Saloon Connector" artisan-create-saloon-connector)]
["Commands"
;; ("t" "Test" artisan-test-transient)
@@ -59,6 +53,21 @@
("mM" "Make Model" artisan-make-model-transient)
("mf" "Make Factory" artisan-make-factory-transient)])
+(defun artisan-create-saloon-connector (integration name)
+ "Create a new saloon connector.
+INTEGRATION is the related integration. NAME is the name of the saloon
+connector."
+ (interactive "MIntegration: \nMName: ")
+ (let ((default-directory (expand-file-name "chanced" (project-root (project-current)))))
+ (shell-command (format "docker exec chanced-backend php artisan saloon:connector %s %s" (shell-quote-argument integration) (shell-quote-argument name)))
+ (let* ((root (project-root (project-current)))
+ (bad-file-name (expand-file-name (format "chanced/app/Http/Integrations/%s/%s.php" integration name) root))
+ (good-file-name (expand-file-name (format "common/app/Http/Integrations/%s/%s.php" integration name) root)))
+ (mkdir (file-name-directory good-file-name) t)
+ (rename-file bad-file-name good-file-name)
+ (find-file good-file-name))
+ (vc-register)))
+
(defun artisan-punt-composer-install ()
(interactive)
(let ((default-directory (expand-file-name "punt" (project-root (project-current)))))