Browse code

Add config alias browse

Robert Cranston authored on 12/02/2023 03:55:41
Showing 1 changed files

... ...
@@ -231,6 +231,20 @@
231 231
 	  | sort -u; \
232 232
 	}; f"
233 233
 
234
+	; Browse.
235
+	browse ="!f() { : ; \
236
+	  set --; \
237
+	  urls=\"$(git remote get-url ${@:-$(git remote)})\"; \
238
+	  for url in $urls; \
239
+	  do \
240
+	    echo $url; \
241
+	    { [ $(command -v xdg-open) ] && xdg-open \"$url\"; } || \
242
+	    { [ $(command -v open)     ] && open     \"$url\"; } || \
243
+	    { [ $(command -v start)    ] && start    \"$url\"; } || \
244
+	    echo \"$@\"; \
245
+	  done; \
246
+	}; f"
247
+
234 248
 	; Log.
235 249
 	l = "!f() { : git log ; \
236 250
 	  git config --get-colorbool color.diff && color_diff=always; \