You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-11-06 09:09:19 +02:00
readPipelineEnv -> Serialize Directly to os.Stdout (#3180)
* Serialize CPE Directly to os.Stdout
This commit is contained in:
@@ -37,13 +37,11 @@ func runReadPipelineEnv() error {
|
||||
return err
|
||||
}
|
||||
|
||||
bytes, err := json.MarshalIndent(cpe, "", "\t")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = os.Stdout.Write(bytes)
|
||||
if err != nil {
|
||||
encoder := json.NewEncoder(os.Stdout)
|
||||
encoder.SetIndent("", "\t")
|
||||
if err := encoder.Encode(cpe); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user