Last active
August 29, 2015 14:10
-
-
Save camdez/32f2896f6207a612bd49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-after-load 'projectile | |
'(add-hook 'find-file-hook 'camdez/warn-if-longhorn-version)) | |
(defun camdez/warn-if-longhorn-version () | |
(interactive) | |
(when (projectile-project-p) | |
(let* ((file-name (buffer-file-name)) | |
(project-dir (projectile-project-root)) | |
(views-dir (concat project-dir "app/views/")) | |
(lh-views-dir (concat project-dir "app/longhorn_views/"))) | |
(when (string-match (concat "^" views-dir) file-name) | |
(let* ((file-rel-name (substring file-name (match-end 0))) | |
(lh-file-name (concat lh-views-dir file-rel-name))) | |
(when (file-exists-p lh-file-name) | |
(message "Warning: there is a Longhorn version of this file"))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For @amirrajan. :)