File: set-version

package info (click to toggle)
weakforced 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,040 kB
  • sloc: cpp: 20,397; python: 2,002; sh: 700; makefile: 432
file content (21 lines) | stat: -rwxr-xr-x 328 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
VERSION=$1
[ -z "$VERSION" ] && exit 1
OS=`uname`
SED_ARG='-r'

if [ $OS == "Darwin" ]
then
  SED_ARG='-E'
fi

for i in wforce_api.7.yml trackalert_api.7.yml
do
    sed $SED_ARG "s/version:(.*)/version: \"$VERSION\"/" $i >$i.tmp
    if [ $? != 0 ]
    then
        exit 1
    fi
    mv $i.tmp $i
done
exit 0