jeudi 21 novembre 2019

Conditions from sh syntax to Makefile syntax

I have a certain file UPDATE.sh. The task of this file is to update my program using 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

I have to write the same thing but on Make syntax.

I tried to figure out the conditions in Make, but it didn't work out for me.

Tell me how to write this correctly in Makefile without using:

update:
      ./UPDATE.sh

Aucun commentaire:

Enregistrer un commentaire