Skip to content

Commit

Permalink
fix: quick hotfix to have a default/fallback value for cardinal edito…
Browse files Browse the repository at this point in the history
…r versioning (#59)

## Overview

this is just a quick patch fix to a small bug. i opened a linear ticket
to address this more thoroughly.
https://linear.app/arguslabs/issue/WORLD-1046/cardinal-cardinal-editor-version-map-in-cli

## Brief Changelog


## Testing and Verifying

<!---
Pick one of the following options:

- This change is a trivial rework/code cleanup without any test
coverage.

- This change is already covered by existing tests, such as <describe
test>.

- This change added tests and can be verified as follows:
    - Added unit test that validates ...
    - Added integration tests for end-to-end deployment with ...
    - Extended integration test for ...
    - Manually verified the change by ...
--->
  • Loading branch information
technicallyty committed Apr 9, 2024
1 parent c93e4f8 commit 7a2d4a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions common/teacmd/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ const (
)

var (
defaultVersion = "v0.3.0"
// Cardinal : Cardinal Editor version map
// TODO this version map need to store in somewhere that can be accessed online
cardinalVersionMap = map[string]string{
"v1.2.2-beta": "v0.1.0",
"v1.2.3-beta": "v0.1.0",
"v1.2.4-beta": "v0.3.0",
"v1.2.5-beta": "v0.3.0",
"v1.2.4-beta": defaultVersion,
"v1.2.5-beta": defaultVersion,
}
)

Expand All @@ -64,6 +65,10 @@ func SetupCardinalEditor() error {

downloadURL := latestReleaseURL
downloadVersion, versionIsExist := cardinalVersionMap[cardinalVersion]
if !versionIsExist {
// default to defaultVersion
downloadVersion = defaultVersion
}
if versionIsExist {
downloadURL = fmt.Sprintf("%s/tags/%s", releaseURL, downloadVersion)
}
Expand Down

0 comments on commit 7a2d4a1

Please sign in to comment.