Commit a6f107e87e13

Vincent Demeester <vincent@sbr.pm>
2020-03-07 16:48:43
Fix gh org link without issue ๐Ÿ˜‡
If there is no issue (aka gh:vdemeester/home), point to the repository instead of a `nil` issue Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 4a0c7d2
config/setup-org.el
@@ -501,7 +501,9 @@ like this : [[pt:REGEXP:FOLDER]]"
     (setq expressions (split-string path "#"))
     (setq project (nth 0 expressions))
     (setq issue (nth 1 expressions))
-    (format "https://github.com/%s/issues/%s" project issue))
+    (if issue
+        (format "https://github.com/%s/issues/%s" project issue)
+      (format "https://github.com/%s" project)))
 
   (org-link-set-parameters
    "org"
emacs.org
@@ -4069,7 +4069,9 @@
     (setq expressions (split-string path "#"))
     (setq project (nth 0 expressions))
     (setq issue (nth 1 expressions))
-    (format "https://github.com/%s/issues/%s" project issue))
+    (if issue
+        (format "https://github.com/%s/issues/%s" project issue)
+      (format "https://github.com/%s" project)))
 
   (org-link-set-parameters
    "org"
publish.org
@@ -168,7 +168,9 @@
     (setq expressions (split-string path "#"))
     (setq project (nth 0 expressions))
     (setq issue (nth 1 expressions))
-    (format "https://github.com/%s/issues/%s" project issue))
+    (if issue
+        (format "https://github.com/%s/issues/%s" project issue)
+      (format "https://github.com/%s" project)))
 
   (org-link-set-parameters
    "org"