mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
[INFRASTRUCTURE] Linux/OSX improvements for build.sh
* Use cp -R instead of cp -r since OSX cp does not support -r * Notify user if they do not have npm/dotnet installed * Create wwwroot before using it (else get error in raspbian) * Use unix line endings instead of dos, else wont run on osx and gives warning in linux.
This commit is contained in:
parent
2a63e5e9e2
commit
438239dc9a
20
build.sh
20
build.sh
@ -1,8 +1,20 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
outputFolder='_output'
|
outputFolder='_output'
|
||||||
|
|
||||||
|
CheckRequirements()
|
||||||
|
{
|
||||||
|
if ! command -v npm &> /dev/null
|
||||||
|
then
|
||||||
|
echo "Warning!!! npm not found, it is required for building Kavita!"
|
||||||
|
fi
|
||||||
|
if ! command -v dotnet &> /dev/null
|
||||||
|
then
|
||||||
|
echo "Warning!!! dotnet not found, it is required for building Kavita!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
ProgressStart()
|
ProgressStart()
|
||||||
{
|
{
|
||||||
echo "Start '$1'"
|
echo "Start '$1'"
|
||||||
@ -55,7 +67,8 @@ BuildUI()
|
|||||||
echo 'Building UI'
|
echo 'Building UI'
|
||||||
npm run prod
|
npm run prod
|
||||||
echo 'Copying back to Kavita wwwroot'
|
echo 'Copying back to Kavita wwwroot'
|
||||||
cp -r dist/* ../../API/wwwroot
|
mkdir -p ../../API/wwwroot
|
||||||
|
cp -R dist/* ../../API/wwwroot
|
||||||
cd ../../ || exit
|
cd ../../ || exit
|
||||||
ProgressEnd 'Building UI'
|
ProgressEnd 'Building UI'
|
||||||
}
|
}
|
||||||
@ -75,7 +88,7 @@ Package()
|
|||||||
dotnet publish -c Release --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework
|
dotnet publish -c Release --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework
|
||||||
|
|
||||||
echo "Recopying wwwroot due to bug"
|
echo "Recopying wwwroot due to bug"
|
||||||
cp -r ./wwwroot/* $lOutputFolder/wwwroot
|
cp -R ./wwwroot/* $lOutputFolder/wwwroot
|
||||||
|
|
||||||
echo "Copying Install information"
|
echo "Copying Install information"
|
||||||
cp ../INSTALL.txt "$lOutputFolder"/README.txt
|
cp ../INSTALL.txt "$lOutputFolder"/README.txt
|
||||||
@ -101,6 +114,7 @@ Package()
|
|||||||
|
|
||||||
RID="$1"
|
RID="$1"
|
||||||
|
|
||||||
|
CheckRequirements
|
||||||
BuildUI
|
BuildUI
|
||||||
Build
|
Build
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user