-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTVDocumentation.command
More file actions
executable file
·48 lines (25 loc) · 1.49 KB
/
STVDocumentation.command
File metadata and controls
executable file
·48 lines (25 loc) · 1.49 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh
set -e
cd ~/Xcode/@SwiftPackages/STV/
# module_version: 6.0.1(2)
OLD_MODULE_VERSION=$(yq read .jazzy.yaml module_version)
echo "\n\n**** STVDocumentation "$OLD_MODULE_VERSION
VERSION=`echo $OLD_MODULE_VERSION | awk -F "(" '{print $1}'`
OLD_BUILD=`echo $OLD_MODULE_VERSION | awk -F "(" '{print $2}'`
OLD_BUILD=`echo $OLD_BUILD | awk -F ")" '{print $1}'`
NEW_BUILD=$(($OLD_BUILD + 1))
NEW_MODULE_VERSION="${VERSION}(${NEW_BUILD})"
# deletes the copyright line, which is the last line
sed -i '' '/^copyright/d' .jazzy.yaml
DATE=`(date +"%Y%m%d")`
YEAR=`(date +"%Y")`
COPYRIGHT="copyright: \"[STV ${NEW_MODULE_VERSION}](https://github.com/daveguerin/STV/) ${DATE}<br />© Copyright 2010 - 2015 [Sensible Cocoa](http://sensiblecocoa.com/)<br />© Copyright 2019 - ${YEAR} [dgApps](http://dgapps.ie/)<br />[STV](https://github.com/daveguerin/STV/) and it's [Documentation](https://github.com/daveguerin/STVDocumentation/) are licensed under a [MIT License](https://github.com/daveguerin/STV/blob/master/License/STV.txt)\""
echo "\n**** STVDocumentation Updating to "$NEW_MODULE_VERSION
yq write -i .jazzy.yaml module_version "${NEW_MODULE_VERSION}"
#yq had problems with ' and " and ` so this appends the copyright line to the bottom of the file
echo "${COPYRIGHT}" >> .jazzy.yaml
STV="STV "
# replaces the first line with STV 6.0.1(2) for example
sed -i '' '1 s/^#.*$/'"# $STV $NEW_MODULE_VERSION"'/' DOCUMENTATION.md
jazzy
echo "\n\n**** STVDocumentation Updated ****\n\n\n\n\n\n\n"