forked from reflex-frp/reflex-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhack-add
More file actions
executable file
·26 lines (19 loc) · 775 Bytes
/
hack-add
File metadata and controls
executable file
·26 lines (19 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -eu
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "$DIR/common-setup.sh"
REPO="$1"
DIFF="$(git -C "$REPO/.." diff --cached -- "$REPO/git.json")"
DIFF_ERR=$?
if [ "$DIFF_ERR" -ne 0 ] ; then
>&2 echo "Error: could not determine whether $REPO/git.json already has pending modifications"
exit 1
elif [ -n "$DIFF" ] ; then
>&2 echo -n "$DIFF"
>&2 echo "Error: $REPO/git.json has pending modifications"
exit 1
fi
get_git_manifest "$REPO"
GIT_MANIFEST="$OUTPUT_GIT_MANIFEST"
GIT_MANIFEST_TYPE="$OUTPUT_GIT_MANIFEST_TYPE"
diff -u --label "a/$REPO/$GIT_MANIFEST_TYPE.json" --label "b/$REPO/$GIT_MANIFEST_TYPE.json" <(git -C "$REPO/.." show "HEAD:$REPO/$GIT_MANIFEST_TYPE.json") <(echo "$GIT_MANIFEST") | git apply --cached