Documentation
¶
Overview ¶
Copyright 2025 PRAS
Copyright 2025 PRAS
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckForUpdates = func() { const host = "api.github.com" const path = "/repos/PRASSamin/prasmoid/releases/latest" const checkInterval = 24 * time.Hour cache, err := readUpdateCache() if err == nil { if lastCheckedStr, ok := cache["last_checked"].(string); ok { lastCheckedTime, err := timeParse(time.RFC3339, lastCheckedStr) if err == nil && timeSince(lastCheckedTime) < checkInterval { if latestTag, ok := cache["latest_tag"].(string); ok { if isUpdateAvailable(latestTag) { printUpdateMessage(latestTag) } } return } } } conn, err := tlsDial("tcp", host+":443", nil) if err != nil { return } defer func() { if err := connClose(conn); err != nil { logPrintf("Error closing connection: %v", err) } }() request := fmt.Sprintf( "GET %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: Prasmoid-Updater\r\nConnection: close\r\n\r\n", path, host, ) _, err = connWrite(conn, []byte(request)) if err != nil { return } raw, err := ioReadAll(conn) if err != nil { return } parts := strings.SplitN(string(raw), "\r\n\r\n", 2) if len(parts) < 2 { return } headers := parts[0] body := parts[1] if !strings.Contains(headers, "200 OK") { return } latestTag := getLatestTag([]byte(body)) writeUpdateCache(latestTag, []byte(body)) if isUpdateAvailable(latestTag) { printUpdateMessage(latestTag) } }
View Source
var ConfigRC types.Config
project wise prasmoid config
View Source
var GetCacheFilePath = func() string { dir, err := osUserCacheDir() if err != nil { dir = osTempDir() } return filepath.Join(dir, "prasmoid_update.json") }
View Source
var RootCmd = &cobra.Command{ Use: "prasmoid", Short: "Manage plasmoid projects", Long: "CLI for building, packaging, and managing KDE plasmoid projects efficiently.", Run: func(cmd *cobra.Command, args []string) { if cmd.Flag("version").Changed { fmt.Println(internalAppMetaDataVersion) osExit(0) } if err := cmd.Help(); err != nil { logPrintf("Error displaying help: %v", err) } }, }
rootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.