utils/functions library

Utility functions for handling YAML, string manipulation, file operations, and system environment.

Properties

gitHubToken → String?
Retrieves the GitHub token from environment variables.
no setter

Functions

assertOsWindows() → void
Asserts that the current operating system is Windows, else exits with an error.
camelCase(String value) → String
Converts a string to camelCase.
capitalize(String value) → String
Capitalizes the first letter of a string.
compareVersions(String a, String b) → int
Compares two dotted version strings numerically, e.g. 6.10.0 > 6.3.3.
generateEssentials(File pubspecFile, File configFile, InnoBundleCliConfig cliConfig) → void
Generates a new app id (as UUID) for the app, if not already present. The new id is persisted in the config file.
getHomeDir() → String
Retrieves the user's home directory path.
getSystemUserName() → String?
Get the logged in username in the machine.
persistDefaultInstallerIcon(String dirPath) → String
Persists the default installer icon to a file in the given directory.
readYaml(File yamlFile) → Map<String, dynamic>
Reads the yamlFile and returns a map of its contents. The yamlFile is passed as a File object instead of being hardcoded because in the future, we may support reading multiple files for configuration.
sha256HashFile(String filePath) → Future<String?>
Computes the SHA256 hash of a file using certutil (Windows).
yamlToList(YamlList yamlList) → List
Convert yaml list to list, this prevents some weird behaviors that come with YamlList type.
yamlToMap(YamlMap yamlMap) → Map<String, dynamic>
Convert yaml to map, this prevents some weird behaviors that come with YamlMap type.