Skip to content

Commit

Permalink
Merge pull request #258 from mkobayashime/open-dist
Browse files Browse the repository at this point in the history
Add a bash script for opening dist URL in browser
  • Loading branch information
mkobayashime authored Nov 10, 2023
2 parents 4c7bb77 + 0daea5b commit 4f44215
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ test.watch: install

scaffold.script:
@./bin/scaffold-script.sh

open.dist.in.remote:
@./bin/open-dist-in-remote.sh
11 changes: 11 additions & 0 deletions bin/open-dist-in-remote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

pushd dist > /dev/null

target=$(fd -t f | fzf)
[[ ! "$target" ]] && exit 0

url=$(grep '@updateURL' < "$target" | sed -E 's#^// @updateURL\s+##')
[[ "$url" ]] && open "$url"

0 comments on commit 4f44215

Please sign in to comment.