stdout: remove file after use

This commit is contained in:
q
2025-03-06 18:26:14 +01:00
parent 32168718c9
commit 99b7d16de7
2 changed files with 7 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"
"github.com/spf13/cobra"
@@ -180,6 +181,7 @@ var getCmd = &cobra.Command{
if err != nil {
log.Fatal(err)
}
os.Remove(filename)
fmt.Println(string(bytesRead))
} else {
@@ -194,6 +196,7 @@ var getCmd = &cobra.Command{
if err != nil {
log.Fatal(err)
}
os.Remove(filename)
book := make(map[string]interface{})
book["name"] = c.Name()
@@ -215,6 +218,7 @@ var getCmd = &cobra.Command{
if err != nil {
log.Fatal(err)
}
os.Remove(filename)
fmt.Println(string(bytesRead))
} else {
@@ -230,6 +234,7 @@ var getCmd = &cobra.Command{
if err != nil {
log.Fatal(err)
}
os.Remove(filename)
fmt.Println(string(bytesRead))
} else {
@@ -245,6 +250,7 @@ var getCmd = &cobra.Command{
if err != nil {
log.Fatal(err)
}
os.Remove(filename)
fmt.Println(string(bytesRead))
} else {

View File

@@ -14,6 +14,6 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of papeer",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("papeer v0.8.3")
fmt.Println("papeer v0.8.4")
},
}