11#! /bin/bash
22
3- # Nitrocid KS Copyright (C) 2018-2025 Aptivi
4- #
5- # This file is part of Nitrocid KS
6- #
7- # Nitrocid KS is free software: you can redistribute it and/or modify
8- # it under the terms of the GNU General Public License as published by
9- # the Free Software Foundation, either version 3 of the License, or
10- # (at your option) any later version.
11- #
12- # Nitrocid KS is distributed in the hope that it will be useful,
13- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15- # GNU General Public License for more details.
16- #
17- # You should have received a copy of the GNU General Public License
18- # along with this program. If not, see <https://www.gnu.org/licenses/>.
3+ # Repository root
4+ ROOTDIR=$( cd -- " $( dirname -- " $0 " ) /.." & > /dev/null && pwd )
195
206# Convenience functions
217checkerror () {
@@ -26,8 +12,8 @@ checkerror() {
2612 fi
2713}
2814
29- # This script builds KS and packs the artifacts. Use when you have MSBuild installed .
30- ksversion =$( grep " <Version>" .. /Directory.Build.props | cut -d " <" -f 2 | cut -d " >" -f 2)
15+ # This script builds the documentation and packs the artifacts.
16+ version =$( grep " <Version>" $ROOTDIR /Directory.Build.props | cut -d " <" -f 2 | cut -d " >" -f 2)
3117checkerror $? " Failed to get version. Check to make sure that the version is specified correctly in D.B.props"
3218
3319# Check for dependencies
@@ -36,17 +22,17 @@ checkerror $? "zip is not found"
3622
3723# Pack documentation
3824echo Packing documentation...
39- cd " .. /docs/" && " $zippath " -r /tmp/$ksversion -doc.zip . && cd -
25+ cd " $ROOTDIR /docs/" && " $zippath " -r /tmp/$version -doc.zip . && cd -
4026checkerror $? " Failed to pack"
4127
4228# Inform success
43- rm -rf " .. /DocGen/api"
29+ rm -rf " $ROOTDIR /DocGen/api"
4430checkerror $? " Failed to remove api folder"
45- rm -rf " .. /DocGen/obj"
31+ rm -rf " $ROOTDIR /DocGen/obj"
4632checkerror $? " Failed to remove obj folder"
47- rm -rf " .. /docs"
33+ rm -rf " $ROOTDIR /docs"
4834checkerror $? " Failed to remove docs folder"
49- mv /tmp/$ksversion -doc.zip .
35+ mv /tmp/$version -doc.zip " $ROOTDIR /tools "
5036checkerror $? " Failed to move archive from temporary folder"
5137echo Pack successful.
5238exit 0
0 commit comments