Skip to content

Commit 96e4975

Browse files
authored
chore: Official Homebrew Formulae adaptation (#49)
* chore: Update brew install instructions in readme * chore: Replace current versioning setup for compatibility with Homebrew Formulae * chore: Add obsidian plugin usage note in readme * fix: Add symlink to 'excalidraw-converter'
1 parent b787bba commit 96e4975

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ jobs:
1313
-
1414
name: Checkout
1515
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
1816
-
1917
name: Set up Go
2018
uses: actions/setup-go@v5
19+
-
20+
name: Update version.go with Git tag and commit SHA
21+
run: |
22+
sed -i 's/version *= *"[^"]*"/version = "${{ github.ref_name }}"/' cmd/version.go
23+
sed -i 's/commit *= *"[^"]*"/commit = "${{ github.sha }}"/' cmd/version.go
2124
-
2225
name: Run GoReleaser
2326
uses: goreleaser/goreleaser-action@v4

.goreleaser.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ builds:
2222
env:
2323
- CGO_ENABLED=0
2424
ldflags:
25-
- -s -w -X diagram-converter/cmd.version={{.Version}} -X diagram-converter/cmd.commit={{.Commit}}
25+
- -s -w
2626
archives:
2727
-
2828
format_overrides:
@@ -76,3 +76,4 @@ brews:
7676
# Default is 'bin.install "program"'.
7777
install: |
7878
bin.install "exconv"
79+
bin.install_symlink "#{bin}/exconv" => "excalidraw-converter"

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@ Excalidraw Converter ports Excalidraw diagrams to a Gliffy compatible format, wh
1111
## Getting started
1212

1313
### Installation
14-
#### MacOS with [Homebrew](https://brew.sh/)
14+
#### MacOS with [Homebrew](https://brew.sh/) (stable)
15+
```shell
16+
brew install excalidraw-converter
17+
```
18+
19+
<details>
20+
<summary>Latest releases</summary>
21+
22+
Use this tap to stay on the latest releases that have not (yet) been added to the official Homebrew Formulae:
23+
1524
```shell
1625
brew install sindrel/tap/excalidraw-converter
1726
```
27+
</details>
28+
1829

1930
#### Installation for other OSes
2031
Download a compatible binary from the [Releases](https://github.com/sindrel/excalidraw-converter/releases) page.
@@ -150,6 +161,9 @@ In draw.io, you can import a diagram by simply opening the file from your device
150161

151162
Note that this is [only supported in the online version](https://www.drawio.com/blog/import-gliffy-online) of draw.io, not the desktop app.
152163

164+
## Compatibility with Excalidraw for Obsidian
165+
Diagrams created using the [Excalidraw for Obsidian plugin](https://github.com/zsviczian/obsidian-excalidraw-plugin) must be exported before conversion, as described [here](https://github.com/sindrel/excalidraw-converter/issues/27#issuecomment-1759964572).
166+
153167
## Contributing
154168
See something you'd like to improve? Great! See the [contributing guidelines](CONTRIBUTING.md) for instructions.
155169

cmd/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ var versionCmd = &cobra.Command{
2121
Short: "Output the application version",
2222
Long: `This command provides information about the release version and the Git commit it was built from.`,
2323
Run: func(cmd *cobra.Command, args []string) {
24-
fmt.Printf("v%s (%s)\n", version, string(commit[0:7]))
24+
fmt.Printf("%s (%s)\n", version, string(commit[0:7]))
2525

2626
if !noVersionCheck {
27-
err := internal.PrintVersionCheck(githubRepoUser, githubRepoName, "v"+version)
27+
err := internal.PrintVersionCheck(githubRepoUser, githubRepoName, version)
2828
if err != nil {
2929
fmt.Fprintf(os.Stderr, "Unable to check for latest version: %s\n", err)
3030
os.Exit(1)

internal/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func PrintVersionCheck(user, repo, version string) error {
6363
}
6464

6565
if !isLatest {
66-
fmt.Printf("\nA newer version is available (%s). Go to 'https://github.com/%s/%s/releases' to download the latest version.\n", latest, user, repo)
66+
fmt.Printf("\nA newer version is available (%s). Go to 'https://github.com/%s/%s' for instructions on how to install the latest version.\n", latest, user, repo)
6767
} else {
6868
fmt.Printf("\nYou are using the latest version.\n")
6969
}

0 commit comments

Comments
 (0)