Skip to content

Commit

Permalink
Merge pull request #48 from ironstar-io/bugfix-NANKAI-572-upload
Browse files Browse the repository at this point in the history
Fix custom package logging
  • Loading branch information
ironmike-au committed Jun 20, 2024
2 parents 47beb0a + fea18c3 commit 9ffcc0a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION_PATH ?= github.com/ironstar-io/ironstar-cli/internal/system/version
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
VERSION ?= $(shell git describe --tags)
GO_IMAGE ?= golang:1.21
GO_IMAGE ?= golang:1.22

DOCKER_SCRIPT=docker run --rm \
-v $(PWD)/.cache/go:/.cache \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ironstar-io/ironstar-cli

go 1.21
go 1.22

require (
github.com/blang/semver v3.5.1+incompatible
Expand Down
3 changes: 0 additions & 3 deletions internal/api/req.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ func (r *Request) HTTPSDownload(filepath, friendlyName string) (*RawResponse, er
out.Close()
return nil, err
}
if err != nil {
return nil, err
}

ir := &RawResponse{
StatusCode: resp.StatusCode,
Expand Down
6 changes: 5 additions & 1 deletion internal/api/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// UploadPackage - Create a project tarball in tmp
func UploadPackage(creds types.Keylink, subHash, tarpath string, flg flags.Accumulator) (*RawResponse, error) {
if flg.CustomPackage != "" {
if flg.CustomPackage == "" {
color.Red(`Warning! This command uploads the contents of this directory to your Ironstar Subscription. Only paths listed under the "exclude" settings in your .ironstar/config.yml file will be excluded.
This means that any database files, .env files, or other potentially sensitive content that you have in this repository that is not in the exclude list will be uploaded to the remote environment and possibly made publicly visible.
Expand Down Expand Up @@ -61,6 +61,10 @@ Please proceed with caution.
console.SpinPersist(wo, "⛔", "There was an error while uploading the package\n")
return nil, err
}
if res.StatusCode < 199 || res.StatusCode > 299 {
console.SpinPersist(wo, "⛔", "There was an error while uploading the package\n")
return nil, fmt.Errorf("an error occurred with status %d: %s", res.StatusCode, res.Body)
}

console.SpinPersist(wo, "💾", "Package upload completed successfully!\n")
return res, nil
Expand Down

0 comments on commit 9ffcc0a

Please sign in to comment.