Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
xplshn committed Mar 9, 2024
1 parent 9302fad commit 6360047
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Binary file modified bigdl
Binary file not shown.
7 changes: 5 additions & 2 deletions helperFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,11 @@ func truncateSprintf(format string, a ...interface{}) string {

// truncatePrintf is a drop-in replacement for fmt.Printf that truncates the input string if it exceeds a certain length.
func truncatePrintf(format string, a ...interface{}) (n int, err error) {
formatted := truncateSprintf(format, a...)
return fmt.Print(formatted)
if disableTruncation {
return fmt.Print(fmt.Sprintf(format, a...))
} else {
return fmt.Print(truncateSprintf(format, a...))
}
}

// NOTE: Both truncate functions will remove the escape sequences of truncated lines, and sometimes break them in half because of the truncation. Avoid using escape sequences with truncate functions, as it is UNSAFE.
20 changes: 14 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import (
)

var (
Repositories []string
MetadataURLs []string
validatedArch = [3]string{}
InstallDir = os.Getenv("INSTALL_DIR")
installUseCache = true
useProgressBar = true
Repositories []string
MetadataURLs []string
validatedArch = [3]string{}
InstallDir = os.Getenv("INSTALL_DIR")
installUseCache = true
useProgressBar = true
disableTruncation = false
)

const (
Expand Down Expand Up @@ -61,6 +62,13 @@ func init() {
MetadataURLs = append(MetadataURLs, "https://bin.ajam.dev/"+arch+"/METADATA.json")
MetadataURLs = append(MetadataURLs, "https://bin.ajam.dev/"+arch+"/Baseutils/METADATA.json")
MetadataURLs = append(MetadataURLs, "https://api.github.com/repos/xplshn/Handyscripts/contents") // You may add other repos if need be? bigdl is customizable, feel free to open a PR, ask questions, etc.

if os.Getenv("DISABLE_TRUNCATION") == "true" || os.Getenv("DISABLE_TRUNCATION") == "1" {
disableTruncation = true
}
if os.Getenv("DISABLE_PRBAR") == "true" || os.Getenv("DISABLE_PRBAR") == "1" {
useProgressBar = false
}
}

func printHelp() {
Expand Down

0 comments on commit 6360047

Please sign in to comment.