-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·29 lines (23 loc) · 1.29 KB
/
publish.sh
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
27
28
29
#!/bin/bash
VERSION=$1
#replace version number in json files
sed -i '' "s/^.*\"version\":.*$/ \"version\": \"${VERSION}\",/" purchasely/package.json
#sed -i '' "s/^.*\#plugin id=\"@purchasely#cordova-plugin-purchasely\" \"version\"=.*$/plop/" purchasely/plugin.xml
sed -i '' "s/^.*\"version\":.*$/ \"version\": \"${VERSION}\",/" purchasely-google/package.json
#sed -i '' "s/^.*id=\"@purchasely/cordova-plugin-purchasely-google\" \"version\"=.*$/id=\"@purchasely/cordova-plugin-purchasely-google\" \"version\"=\"${VERSION}\",/" purchasely-google/plugin.xml
#replace version number in Purchasely.js
sed -i '' "s/^.* cordovaSdkVersion.*$/ cordovaSdkVersion = \"${VERSION}\";/" purchasely/www/Purchasely.js
#publish
if [[ $2 = true ]]
then
cd purchasely && npm publish --access public
cd ../purchasely-google && npm publish --access public
else
echo "BEFORE calling same command with true as second parameter"
echo "Update both plugin.xml files manually to ${VERSION}"
echo "You should have"
echo "<plugin id=\"@purchasely/cordova-plugin-purchasely\" \"version\"=\"${VERSION}\""
echo "<plugin id=\"@purchasely/cordova-plugin-purchasely-google\" \"version\"=\"${VERSION}\""
#cd purchasely && yarn && yarn prepare
#cd ../purchasely-google && yarn && yarn prepare
fi