Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
2.9/3
Browse files Browse the repository at this point in the history
  • Loading branch information
xplshn committed Mar 2, 2024
1 parent fc0bfc9 commit b28abb4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Binary file modified bigdl
Binary file not shown.
15 changes: 13 additions & 2 deletions helperFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"syscall"
)

var indicator string = "..>"

// signalHandler sets up a channel to listen for interrupt signals and returns a function
// that can be called to check if an interrupt has been received.
func signalHandler(ctx context.Context, cancel context.CancelFunc) (func() bool, error) {
Expand Down Expand Up @@ -98,6 +100,15 @@ func fetchBinaryFromURL(url, destination string) error {
if useProgressBar {
bar = progressbar.NewOptions(int(resp.ContentLength),
progressbar.OptionClearOnFinish(),
progressbar.OptionFullWidth(),
progressbar.OptionShowBytes(true),
progressbar.OptionSetTheme(progressbar.Theme{
Saucer: "=",
SaucerHead: ">",
SaucerPadding: " ",
BarStart: "[",
BarEnd: "]",
}),
)
} else {
bar = progressbar.NewOptions(-1,
Expand Down Expand Up @@ -277,13 +288,13 @@ func truncateSprintf(format string, a ...interface{}) string {
formatted := fmt.Sprintf(format, a...)

// Determine the truncation length & truncate the formatted string if it exceeds the available space
availableSpace := getTerminalWidth() - 4
availableSpace := getTerminalWidth() - len(indicator)
if len(formatted) > availableSpace {
formatted = fmt.Sprintf("%s", formatted[:availableSpace])
for strings.HasSuffix(formatted, ",") || strings.HasSuffix(formatted, ".") || strings.HasSuffix(formatted, " ") {
formatted = formatted[:len(formatted)-1]
}
formatted = fmt.Sprintf("%s...>", formatted) // Add the dots.
formatted = fmt.Sprintf("%s%s", formatted, indicator) // Add the dots.
}

return formatted
Expand Down
7 changes: 0 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ import (
"runtime"
)

// Repositories contains the URLs for fetching metadata.
var Repositories []string

// MetadataURLs contains the URLs for fetching metadata.
var MetadataURLs []string

// Array for storing a variable that fsearch and info use.
var validatedArch = [3]string{}

// You may hardcode the default value if need be
var InstallDir = os.Getenv("INSTALL_DIR")

func init() {
Expand Down

0 comments on commit b28abb4

Please sign in to comment.