show size in mb
This commit is contained in:
parent
45f2a862ff
commit
75089f4a6c
@ -8,6 +8,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
@ -199,9 +200,11 @@ func checkBinarySizeActionFunc(c *cli.Context) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fileSize := fileInfo.Size()
|
fileSize := fileInfo.Size()
|
||||||
|
fileSizeMB := float64(fileSize) / float64(1000000)
|
||||||
|
roundedFileSizeMB := math.Round(fileSizeMB*10) / 10
|
||||||
|
|
||||||
// show the file size
|
// show the file size
|
||||||
fmt.Println(fileSize)
|
fmt.Println(fmt.Sprintf("current binary size is: %.1fMB", roundedFileSizeMB))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user