mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: add ssr placeholder in index.html
This commit is contained in:
@@ -85,16 +85,16 @@ if (!$?) {
|
||||
}
|
||||
|
||||
Write-Host "`nBacking up frontend placeholder..." -f Magenta
|
||||
Move-Item "$repoRoot/server/dist" "$repoRoot/server/dist.bak" -Force -ErrorAction Stop
|
||||
Move-Item "$repoRoot/server/frontend/dist" "$repoRoot/server/frontend/dist.bak" -Force -ErrorAction Stop
|
||||
if (!$?) {
|
||||
Write-Host -BackgroundColor red -ForegroundColor white "Could not backup frontend placeholder. See above."
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Write-Host "Moving frontend build to ./server/dist..." -f Magenta
|
||||
Write-Host "Moving frontend build to ./server/frontend/dist..." -f Magenta
|
||||
Move-Item "$repoRoot/web/dist" "$repoRoot/server/" -Force -ErrorAction Stop
|
||||
if (!$?) {
|
||||
Write-Host -BackgroundColor red -ForegroundColor white "Could not move frontend build to /server/dist. See above."
|
||||
Write-Host -BackgroundColor red -ForegroundColor white "Could not move frontend build to /server/frontend/dist. See above."
|
||||
Exit 1
|
||||
}
|
||||
|
||||
@@ -126,15 +126,15 @@ Write-Host "Backend built!" -f green
|
||||
Write-Host "`nFrontend build took $($frontendTime.TotalSeconds) seconds." -f Cyan
|
||||
Write-Host "Backend builds took $($backendTime.TotalSeconds) seconds." -f Cyan
|
||||
|
||||
Write-Host "`nRemoving frontend from ./server/dist ..." -f Magenta
|
||||
Remove-Item "$repoRoot/server/dist" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Write-Host "`nRemoving frontend from ./server/frontend/dist ..." -f Magenta
|
||||
Remove-Item "$repoRoot/server/frontend/dist" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if (!$?) {
|
||||
Write-Host -BackgroundColor red -ForegroundColor white "Could not remove frontend from /server/dist. See above."
|
||||
Write-Host -BackgroundColor red -ForegroundColor white "Could not remove frontend from /server/frontend/dist. See above."
|
||||
Exit 1
|
||||
}
|
||||
|
||||
Write-Host "Restoring frontend placeholder..." -f Magenta
|
||||
Move-Item "$repoRoot/server/dist.bak" "$repoRoot/server/dist" -Force -ErrorAction Stop
|
||||
Move-Item "$repoRoot/server/frontend/dist.bak" "$repoRoot/server/frontend/dist" -Force -ErrorAction Stop
|
||||
if (!$?) {
|
||||
Write-Host -BackgroundColor red -ForegroundColor white "Could not restore frontend placeholder. See above."
|
||||
Exit 1
|
||||
|
@@ -93,13 +93,13 @@ echo -e "\033[32mFrontend built!\033[0m"
|
||||
cd $repo_root
|
||||
|
||||
echo -e "\n\033[35mBacking up frontend placeholder...\033[0m"
|
||||
mv -f "$repo_root/server/dist" "$repo_root/server/dist.bak"
|
||||
mv -f "$repo_root/server/frontend/dist" "$repo_root/server/frontend/dist.bak"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\033[0;31mFailed to backup frontend placeholder! Exiting.\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\033[35mMoving frontend build to ./server/dist...\033[0m"
|
||||
echo -e "\033[35mMoving frontend build to ./server/frontend/dist...\033[0m"
|
||||
mv -f "$repo_root/web/dist" "$repo_root/server/"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\033[0;31mFailed to move frontend build! Exiting.\033[0m"
|
||||
@@ -129,16 +129,16 @@ done
|
||||
|
||||
echo -e "\033[32mBackend built!\033[0m"
|
||||
|
||||
echo -e "\n\033[35mRemoving frontend from ./server/dist...\033[0m"
|
||||
rm -rf $repo_root/server/dist
|
||||
echo -e "\n\033[35mRemoving frontend from ./server/frontend/dist...\033[0m"
|
||||
rm -rf $repo_root/server/frontend/dist
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo -e "\033[93mCould not remove frontend from /server/dist.\033[0m"
|
||||
echo -e "\033[93mCould not remove frontend from /server/frontend/dist.\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\033[35mRestoring frontend placeholder...\033[0m"
|
||||
mv $repo_root/server/dist.bak $repo_root/server/dist
|
||||
mv $repo_root/server/frontend/dist.bak $repo_root/server/frontend/dist
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo -e "\033[93mCould not restore frontend placeholder.\033e[0m"
|
||||
|
Reference in New Issue
Block a user