mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
Fix issue where steampipe returned 0 exit code even if failed to export snapshot. Closes #4276
This commit is contained in:
@@ -317,7 +317,10 @@ func runSingleDashboard(ctx context.Context, targetName string, inputs map[strin
|
|||||||
// export the result (if needed)
|
// export the result (if needed)
|
||||||
exportArgs := viper.GetStringSlice(constants.ArgExport)
|
exportArgs := viper.GetStringSlice(constants.ArgExport)
|
||||||
exportMsg, err := initData.ExportManager.DoExport(ctx, snap.FileNameRoot, snap, exportArgs)
|
exportMsg, err := initData.ExportManager.DoExport(ctx, snap.FileNameRoot, snap, exportArgs)
|
||||||
error_helpers.FailOnErrorWithMessage(err, "failed to export snapshot")
|
if err != nil {
|
||||||
|
exitCode = constants.ExitCodeSnapshotCreationFailed
|
||||||
|
error_helpers.FailOnErrorWithMessage(err, "failed to export snapshot")
|
||||||
|
}
|
||||||
|
|
||||||
// print the location where the file is exported
|
// print the location where the file is exported
|
||||||
if len(exportMsg) > 0 && viper.GetBool(constants.ArgProgress) {
|
if len(exportMsg) > 0 && viper.GetBool(constants.ArgProgress) {
|
||||||
|
|||||||
@@ -281,7 +281,10 @@ func executeSnapshotQuery(initData *query.InitData, ctx context.Context) int {
|
|||||||
// export the result if necessary
|
// export the result if necessary
|
||||||
exportArgs := viper.GetStringSlice(constants.ArgExport)
|
exportArgs := viper.GetStringSlice(constants.ArgExport)
|
||||||
exportMsg, err := initData.ExportManager.DoExport(ctx, snap.FileNameRoot, snap, exportArgs)
|
exportMsg, err := initData.ExportManager.DoExport(ctx, snap.FileNameRoot, snap, exportArgs)
|
||||||
error_helpers.FailOnErrorWithMessage(err, "failed to export snapshot")
|
if err != nil {
|
||||||
|
exitCode = constants.ExitCodeSnapshotCreationFailed
|
||||||
|
error_helpers.FailOnErrorWithMessage(err, "failed to export snapshot")
|
||||||
|
}
|
||||||
// print the location where the file is exported
|
// print the location where the file is exported
|
||||||
if len(exportMsg) > 0 && viper.GetBool(constants.ArgProgress) {
|
if len(exportMsg) > 0 && viper.GetBool(constants.ArgProgress) {
|
||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user