swift - 使用 macOS 应用程序运送 aws-cli

标签 swift macos swift3 aws-cli

我正在开发一个在 aws s3 sync 之上提供 GUI 界面的 MacOS 应用程序命令。

该应用程序不会对 aws 是否存在做出任何假设。命令存在并尝试同时安装 brewaws在设置中通过 brew 命令。

我正在使用 Process来自 swift 3 的类并依赖 which命令检测 brewaws命令,如果不可用,请尝试安装它。粗略地说,swift 3 接口(interface)的脚本如下所示

#!/bin/sh

export PATH=$PATH:/usr/local/bin

if ! [ -x "$(command -v $1)" ]; then
    echo $2
    if [ $1 == "brew" ]; then
        /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" &>/dev/null
    fi
    if [ $1 == "aws" ]; then
        brew install awscli &>/dev/null
    fi
fi

但在不同的 MacOS 版本上,我遇到了管理自动安装的问题。

我想知道是否可以随应用程序一起发布特定版本的“awscli”。我在看类似的东西

cp /usr/local/bin/aws <project folder>然后删除所有自动安装脚本。

最佳答案

关于swift - 使用 macOS 应用程序运送 aws-cli,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44443825/

相关文章:

ios - 如何更改特定操作表上 UIAlertController 上的字体颜色?

php - 在 Mac 上的 XAMPP 上安装 PHP 7.0 国际化扩展 (Intl)

ios - Swift 3 - FTP 上传

ios - Swift 3 - 记住所做的选择

ios - 迁移到 swift 3 现在出现错误 "argument labels ' (_ :)' do not match any available overloads

ios - Facebook 登录 iOS SDK 卡在 "Confirm"

swift - 在 Swift 4 中显示字符值

ios - TableView 项目在滚动时刷新

arrays - swift os x 数组二元运算符与 nil != if 语句比较错误

启动 PyCharm CE 时无法打开 Python