From 94ad50f690674c0eb132b684e0a607e85be9ce77 Mon Sep 17 00:00:00 2001 From: Daniil Subbotin Date: Mon, 22 Jun 2020 14:48:53 +0300 Subject: [PATCH] Add support for Homebrew --- FigmaExport.podspec | 2 +- README.md | 5 +++++ Sources/FigmaExport/Output/FileConverter.swift | 13 +++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/FigmaExport.podspec b/FigmaExport.podspec index 61c3ee4b..028eede1 100644 --- a/FigmaExport.podspec +++ b/FigmaExport.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "FigmaExport" - spec.version = "0.8.3" + spec.version = "0.9.2" spec.summary = "Command line utility to export colors, icons and images from Figma to Xcode / Android Studio project." spec.homepage = "https://github.com/RedMadRobot/figma-export" spec.license = { type: "MIT", file: "LICENSE" } diff --git a/README.md b/README.md index 02e771ad..fe0b57bf 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,11 @@ Images will be exported to `drawable` and `drawable-night` directory as vector x ### Manual [Download](https://github.com/RedMadRobot/figma-export/releases) latest release and read [Usage](#usage) +### Homebrew +``` +brew install subdan/tools/figma-export +``` + ### CocoaPods + Fastlane Add the following line to your Podfile: ```ruby diff --git a/Sources/FigmaExport/Output/FileConverter.swift b/Sources/FigmaExport/Output/FileConverter.swift index 5d9df3b7..9588bd31 100644 --- a/Sources/FigmaExport/Output/FileConverter.swift +++ b/Sources/FigmaExport/Output/FileConverter.swift @@ -5,13 +5,14 @@ final class FileConverter { func convert(inputDirectoryPath: String) throws { let task = Process() - #if DEBUG - task.executableURL = URL(fileURLWithPath: "/Users/d.subbotin/Documents/projects/figma-export/Release/vd-tool/bin/vd-tool") - #else - task.executableURL = URL(fileURLWithPath: "./vd-tool/bin/vd-tool") - #endif + task.executableURL = URL(fileURLWithPath: "/usr/local/bin/vd-tool") task.arguments = ["-c", "-in", inputDirectoryPath] - try task.run() + do { + try task.run() + } catch { + task.executableURL = URL(fileURLWithPath: "./vd-tool/bin/vd-tool") + try task.run() + } task.waitUntilExit() } }