我想用Apple脚本更新我的git Bitbucket在线存储空间。这是在终端中运行的代码,但不是在我运行apple脚本时。
cd /Users/mainuser/Desktop/Projects git add -A
git commit -m fromAppleScript
git push
精心制作成苹果脚本:
say "updating backup"
do shell script "cd /Users/mainuser/Desktop/Projects git add -A"
do shell script "cd /Users/mainuser/Desktop/Projects git commit -m fromAppleScript"
do shell script "cd /Users/mainuser/Desktop/Projects git push"
我有点疑惑为什么这段代码不起作用。你能解决这个问题吗?
答案 0 :(得分:1)
我相信您遇到的问题是在cd
和git add
命令之前使用git commit
命令。您将两个命令链接在一起。
答案 1 :(得分:1)
do shell script "cd /Users/mainuser/Desktop/Projects && git add -A && git commit -m fromAppleScript && git push"