Skip to content

Instantly share code, notes, and snippets.

@camdez
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camdez/32f2896f6207a612bd49 to your computer and use it in GitHub Desktop.
Save camdez/32f2896f6207a612bd49 to your computer and use it in GitHub Desktop.
(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")))))))
@camdez
Copy link
Author

camdez commented Apr 16, 2015

For @amirrajan. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment