【发布时间】:2019-11-21 21:09:04
【问题描述】:
我有一个特定的文件 UPDATE.sh。该文件的任务是使用 git merge 更新我的程序。
UPDATE.sh:
#!/usr/bin/env bash
git fetch https://xxxxx
newUpdatesAvailable=`git diff HEAD FETCH_HEAD`
if [[ "$newUpdatesAvailable" != "" ]]
then
git branch backup
git checkout backup
git add .
git add -u
git commit -m date "+%d.%m.%Y"
git checkout master
git merge FETCH_HEAD
else
echo "No updates..."
fi
我必须写同样的东西,但要使用 Make 语法。
我试图弄清楚 Make 中的条件,但对我来说没有用。
请告诉我如何在不使用的情况下在 Makefile 中正确编写:
update:
./UPDATE.sh
【问题讨论】:
-
这能回答你的问题吗? Basic if else statement in Makefile
标签: if-statement github makefile sh gnu-make