utils

package
v0.0.0-...-cd95803 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBundleIconFilesToPlist

func AddBundleIconFilesToPlist(plistPath string) error

AddBundleIconFilesToPlist adds the CFBundleIconFiles array to the plist

func ConfigureDetachedProcAttr

func ConfigureDetachedProcAttr(cmd *exec.Cmd)

ConfigureDetachedProcAttr configures the command to run in a separate process group on Unix systems, allowing for proper cleanup when the parent process is terminated.

func ConvertPlistToJSON

func ConvertPlistToJSON(plistData []byte, result interface{}) error

ConvertPlistToJSON converts plist bytes to JSON and unmarshals into the provided result

func ConvertPngToJpeg

func ConvertPngToJpeg(pngBytes []byte, quality int) ([]byte, error)

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst

func DownloadFile

func DownloadFile(url, localPath string) error

DownloadFile downloads a file from the given URL to the specified local path

func FindAvailablePortInRange

func FindAvailablePortInRange(startPort, endPort int) (int, error)

func GetLatestReleaseDownloadURL

func GetLatestReleaseDownloadURL(repo string) (string, error)

GetLatestReleaseDownloadURL fetches the latest release from a GitHub repository and returns the browser download URL of the first asset

func GetProjectFile

func GetProjectFile(path string) (string, error)

func Info

func Info(format string, args ...interface{})

func IsPortAvailable

func IsPortAvailable(host string, port int) bool

func IsVerbose

func IsVerbose() bool

func ModifyPlist

func ModifyPlist(input ModifyPlistInput) error

ModifyPlist modifies a plist file using plutil to add or replace a key-value pair

func SetVerbose

func SetVerbose(verbose bool)

func Unzip

func Unzip(zipPath string) (string, error)

func Verbose

func Verbose(format string, args ...interface{})

Types

type GitHubRelease

type GitHubRelease struct {
	Assets []struct {
		BrowserDownloadURL string `json:"browser_download_url"`
		Name               string `json:"name"`
	} `json:"assets"`
}

type ModifyPlistInput

type ModifyPlistInput struct {
	PlistPath string
	Key       string
	Value     string
}

ModifyPlistInput contains parameters for modifying a plist file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL