Skip to content

Commit

Permalink
Change release tarball formatting (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
kavir1698 authored May 16, 2024
1 parent 5496a4b commit dfd14eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ builds:

archives:
- format: tar.gz
wrap_in_directory: true
name_template: >-
{{ .ProjectName }}_
{{ .Version }}_
{{ .ProjectName }}_v{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
Expand Down
8 changes: 4 additions & 4 deletions datasetUtils/checkForNewVersion.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func fetchLatestVersion(client *http.Client) (string, error) {
// Make sure the version number is stripped of the 'v' prefix. That's required for `strconv.Atoi` to work.
func generateDownloadURL(deployLocation, latestVersion, osName string) string {
if strings.ToLower(osName) == "windows" {
return fmt.Sprintf("%s/v%s/scicat-cli_.%s_%s_x86_64.zip", deployLocation, latestVersion, latestVersion, strings.Title(osName))
return fmt.Sprintf("%s/v%s/scicat-cli_v%s_%s_x86_64.zip", deployLocation, latestVersion, latestVersion, strings.Title(osName))
}
return fmt.Sprintf("%s/v%s/scicat-cli_.%s_%s_x86_64.tar.gz", deployLocation, latestVersion, latestVersion, strings.Title(osName))
return fmt.Sprintf("%s/v%s/scicat-cli_v%s_%s_x86_64.tar.gz", deployLocation, latestVersion, latestVersion, strings.Title(osName))
}

func CheckForNewVersion(client *http.Client, APP string, VERSION string) {
Expand Down Expand Up @@ -88,9 +88,9 @@ func CheckForNewVersion(client *http.Client, APP string, VERSION string) {
log.Println("You can either download the file using the browser or use the following command:")

if strings.ToLower(osName) == "windows" {
log.Printf("Browser: %s\nCommand: curl -L -O %s; unzip scicat-cli_.%s_%s_x86_64.zip; cd scicat-cli\n", downloadURL, downloadURL, latestVersion, strings.Title(osName))
log.Printf("Browser: %s\nCommand: curl -L -O %s; unzip scicat-cli_v%s_%s_x86_64.zip; cd scicat-cli\n", downloadURL, downloadURL, latestVersion, strings.Title(osName))
} else {
log.Printf("Browser: %s\nCommand: curl -L -O %s; tar xzf scicat-cli_.%s_%s_x86_64.tar.gz; cd scicat-cli; chmod +x %s\n", downloadURL, downloadURL, latestVersion, strings.Title(osName), APP)
log.Printf("Browser: %s\nCommand: curl -L -O %s; tar xzf scicat-cli_v%s_%s_x86_64.tar.gz; cd scicat-cli; chmod +x %s\n", downloadURL, downloadURL, latestVersion, strings.Title(osName), APP)
}
} else {
log.Println("Your version of this program is up-to-date")
Expand Down
6 changes: 3 additions & 3 deletions datasetUtils/checkForNewVersion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func TestGenerateDownloadURL(t *testing.T) {
}{
{
osName: "Linux",
expectedURL: "https://github.com/paulscherrerinstitute/scicat-cli/releases/download/v0.1.0/scicat-cli_.0.1.0_Linux_x86_64.tar.gz",
expectedURL: "https://github.com/paulscherrerinstitute/scicat-cli/releases/download/v0.1.0/scicat-cli_v0.1.0_Linux_x86_64.tar.gz",
},
{
osName: "Windows",
expectedURL: "https://github.com/paulscherrerinstitute/scicat-cli/releases/download/v0.1.0/scicat-cli_.0.1.0_Windows_x86_64.zip",
expectedURL: "https://github.com/paulscherrerinstitute/scicat-cli/releases/download/v0.1.0/scicat-cli_v0.1.0_Windows_x86_64.zip",
},
{
osName: "Darwin",
expectedURL: "https://github.com/paulscherrerinstitute/scicat-cli/releases/download/v0.1.0/scicat-cli_.0.1.0_Darwin_x86_64.tar.gz",
expectedURL: "https://github.com/paulscherrerinstitute/scicat-cli/releases/download/v0.1.0/scicat-cli_v0.1.0_Darwin_x86_64.tar.gz",
},
}

Expand Down

0 comments on commit dfd14eb

Please sign in to comment.