diff options
| author | 2025-04-10 16:28:51 -0700 | |
|---|---|---|
| committer | 2025-04-10 16:28:51 -0700 | |
| commit | 16c12362dd0b79b2f0506d4bddb8b8fa9a7b7586 (patch) | |
| tree | 4dc7ae6db20468e98272cd2c74387a3f5048eea3 /oni | |
| parent | 00ed427ff64fc0383ec0ed2bacbfcec3f9d64a47 (diff) | |
| download | new-dotfiles-16c12362dd0b79b2f0506d4bddb8b8fa9a7b7586.tar.gz new-dotfiles-16c12362dd0b79b2f0506d4bddb8b8fa9a7b7586.zip | |
pop-os/emacs: Add command to make laravel migrations
This command asks for a name, runs the artisan command, and then opens the
generated file and registers it with the current version control system.
Diffstat (limited to 'oni')
| -rw-r--r-- | oni/home/config/pop-os/emacs.el | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/oni/home/config/pop-os/emacs.el b/oni/home/config/pop-os/emacs.el index 75a7fc6..97390f4 100644 --- a/oni/home/config/pop-os/emacs.el +++ b/oni/home/config/pop-os/emacs.el @@ -45,7 +45,8 @@ ("cam" "Migrate" artisan-chanced-migrate)]] ["Commands" - ("t" "Test" artisan-test-transient)]) + ("t" "Test" artisan-test-transient) + ("mm" "Make Migration" artisan-make-migration-transient)]) (defun artisan-punt-composer-install () (interactive) @@ -146,6 +147,23 @@ buffers.") (forward-line) (search-forward " •")))))) +(transient-define-prefix artisan-make-migration-transient () + "Make migration." + + ["Arguments & Switches"] + + ["Commands" + ("m" "Make" artisan-make-migration)]) + +(defun artisan-make-migration (&optional name) + (interactive "MName: ") + (let ((default-directory (expand-file-name "chanced" (project-root (project-current))))) + (shell-command + (format "docker exec chanced-backend php artisan make:migration --path=../common/database/migrations %S" name)) + (find-file (car (directory-files (expand-file-name "common/database/migrations" (project-root (project-current))) + t (rx "_" (literal name) ".php")))) + (vc-register))) + (require 'dashboard) (dashboard-setup-startup-hook) (run-with-idle-timer 300 t (lambda () (switch-to-buffer dashboard-buffer-name))) |
