xref: /expo/docs/scripts/versionpatch.sh (revision 1c95a29b)
1#!/bin/bash
2
3if [[ $# -lt 2 ]]
4then
5    echo "applies the current git diff in source version in each target version"
6    echo "can be used to, for example, make changes in "'unversioned'" then"
7    echo "duplicate those changes in previous versions"
8    echo
9    echo "usage: from docs directory,"
10    echo "  ./scripts/versionpatch.sh <src> <target1> <target2> ..."
11    echo
12    echo "example:"
13    echo "  ./scripts/versionpatch.sh unversioned v8.0.0 v7.0.0"
14    exit
15fi
16
17src_version=$1
18
19shift
20for version in $*; do
21    pushd versions/$version > /dev/null
22    echo Patching in `pwd`
23    git diff -- ../$src_version | patch -p4
24    popd > /dev/null
25done
26