INNER CODE UNIT · Swift

scriptMain

AgentiLoop/Agent · Agent/GitHubReleasePro.swift:4

public func scriptMain() -> Int32 {
    // Get parameters from environment
    let version = ProcessInfo.processInfo.environment["AGENT_SCRIPT_ARGS"] ?? ""
    
    // Args: version|notes|binaryPath|workingDir (e.g. "v1.0.20|Release notes|./build/App.dmg|/path/to/repo")
    let args = version.components(separatedBy: "|")
    
    guard args.count >= 1, !args[0].isEmpty else {
        print("Usage: Provide arguments as version|notes|binaryPath|workingDir")
        print("Example: v1.0.20|Release notes here|./build/export/App.dmg|/path/to/repo")
        print("Notes support markdown. Use \\n for line breaks in single-line format.")
        return 1
    }
    
    let releaseVersion = args[0]
    let releaseNotes = args.count > 1
        ? formatReleaseNotes(
            args[1].replacingOccurrences(of: "\\n", with: "\n")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…