 import AppIconCore
 import ArgumentParser
+import Foundation
 
 struct AppIcon: ParsableCommand {
     static let configuration = CommandConfiguration(

    @Option(help: "The path of the generated appiconset")
    var outputPath = "AppIcon"

    @Flag(help: "Whether or not to generate iPad icons")
    var ipad = false

    @Flag(help: "Whether or not to generate Mac icons")
    var mac = false

    @Flag(help: "Whether or not to generate Apple Watch icons")
    var watch = false

    func run() throws {
        guard image.hasSuffix(".png") else {
            throw ValidationError("image path should have .png extension")
        }

        let outputExpansion = ".appiconset"

        do {
            try ImageExtractor.extract(input: (image, platforms), output: (iconName, outputPath))
        } catch {
            print("Image Extraction Error has occurred 😱")
            throw ExitCode(1)
        }

        do {
            try JsonExtractor.extract(input: platforms, output: (iconName, outputPath))
        } catch {
            print("Json Extraction Error has occurred 😱")
            throw ExitCode(1)
        }

