Skip to content

Commit

Permalink
Fix running slackv2
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 12, 2024
1 parent 3d9896c commit aa2f3ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions api/gitlab/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,21 @@ func DownloadMautrixBridgeBinary(ctx context.Context, bridge, path string, noUpd
if err != nil {
return fmt.Errorf("failed to get last build info: %w", err)
}
// TODO remove this hack after slackv2 is merged to main
if build.JobURL == "" && ref == "main" && repo == "mautrix/slack" {
build, err = GetLastBuild(domain, repo, "refactor", job)
if err != nil {
return fmt.Errorf("failed to get last build info: %w", err)
}
}
if build.Commit == currentCommit {
log.Printf("[cyan]%s[reset] is up to date (commit: %s)", fileName, linkifyCommit(repo, currentCommit))
return nil
} else if currentCommit != "" && noUpdate {
log.Printf("[cyan]%s[reset] [yellow]is out of date, latest commit is %s (diff: %s)[reset]", fileName, linkifyCommit(repo, build.Commit), linkifyDiff(repo, currentCommit, build.Commit))
return nil
} else if build.JobURL == "" {
return fmt.Errorf("failed to find URL for job %q on branch %s of %s", job, ref, repo)
}
if currentCommit == "" {
log.Printf("Installing [cyan]%s[reset] (commit: %s)", fileName, linkifyCommit(repo, build.Commit))
Expand Down
6 changes: 4 additions & 2 deletions cmd/bbctl/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ func runBridge(ctx *cli.Context) error {
binaryName := fmt.Sprintf("mautrix-%s", cfg.BridgeType)
v2 := false
if strings.HasSuffix(cfg.BridgeType, "v2") {
needsWebsocketProxy = true
binaryName = fmt.Sprintf("mautrix-%s-v2", strings.TrimSuffix(cfg.BridgeType, "v2"))
binaryName = fmt.Sprintf("mautrix-%s", strings.TrimSuffix(cfg.BridgeType, "v2"))
if cfg.BridgeType == "signalv2" {
binaryName += "-v2"
}
v2 = true
}
if cfg.BridgeType == "imessagego" {
Expand Down

0 comments on commit aa2f3ec

Please sign in to comment.