Skip to content

Commit 7bd0db0

Browse files
committed
fix: get --json now only outputs JSON without writing file to disk
1 parent 00cd69f commit 7bd0db0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## In Development
4+
5+
- fix: Il comando `get --json` scriveva anche il file su disco invece di restituire solo il JSON.
6+
37
## [1.0.0-beta.1] - 2025-07-08
48

59
_First pre-release._

cmd/get.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ func getRun(cmd *cobra.Command, args []string) {
4747
}
4848

4949
fmt.Println(string(jsonData))
50+
} else {
51+
ToFile(response.FileName, response.Payload, response.Encoding)
5052
}
5153

52-
ToFile(response.FileName, response.Payload, response.Encoding)
53-
5454
}
5555

5656
func init() {
5757
rootCmd.AddCommand(getCmd)
5858

59-
getCmd.Flags().BoolVar(&asJson, "json", false, "response as json")
59+
getCmd.Flags().BoolVar(&asJson, "json", false, "response as json; no file will be saved")
6060
getCmd.Flags().StringVarP(&outputDir, "dest", "d", "", "destination directory")
6161
}

0 commit comments

Comments
 (0)