diff --git a/bigdl b/bigdl index 8393611..4d082f5 100644 Binary files a/bigdl and b/bigdl differ diff --git a/helperFunctions.go b/helperFunctions.go index 72f4004..dfb6f3c 100644 --- a/helperFunctions.go +++ b/helperFunctions.go @@ -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. diff --git a/main.go b/main.go index fbc8d7e..9e69911 100644 --- a/main.go +++ b/main.go @@ -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 ( @@ -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() {