Skip to content

Commit

Permalink
Merge pull request #797 from ladyisatis/feature/release_fixes
Browse files Browse the repository at this point in the history
Release build fixes
  • Loading branch information
joaorb64 authored Dec 20, 2024
2 parents 334cd25 + ba50598 commit c7a0925
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
6 changes: 3 additions & 3 deletions dependencies/tsh.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ a = Analysis(
('../assets/contributors.txt', 'assets'),
('../assets/versions.json', 'assets'),
('../src/i18n/tournament_term/*.json', 'src/i18n/tournament_term'),
# ('../src/i18n/round_names/*.json', 'src/i18n/round_names'),
# ('../src/i18n/round_names/*.json', 'src/i18n/round_names'),
('../src/i18n/*.json', 'src/i18n'),
('../src/i18n/*.qm', 'src/i18n'),
('../src/layout/*', 'src/layout'),
('../src/TournamentDataProvider/*.txt', 'src/TournamentDataProvider'),
('../stage_strike_app/build/*', 'stage_strike_app/build')
# ('../stage_strike_app/build/*', 'stage_strike_app/build'),
('../src/TournamentDataProvider/*.txt', 'src/TournamentDataProvider')
],
hookspath=[],
runtime_hooks=[],
Expand Down
6 changes: 4 additions & 2 deletions scripts/gen_release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ Remove-Item -Path "TournamentStreamHelper\assets\contributors.txt" -Force

# Copy layout excluding game_images and symlinks
Get-ChildItem -Path "layout" -Recurse | Where-Object {
$_.FullName -notmatch "layout\\game_images" -and -not $_.Attributes.HasFlag([System.IO.FileAttributes]::ReparsePoint)
$_.FullName -notmatch "layout\\game_images" -and
$_.FullName -notmatch "layout\\game_screenshots" -and
-not $_.Attributes.HasFlag([System.IO.FileAttributes]::ReparsePoint)
} | ForEach-Object {
$destination = $_.FullName.Replace("layout", "TournamentStreamHelper\layout")
if ($_.PSIsContainer) {
Expand All @@ -21,7 +23,7 @@ Get-ChildItem -Path "layout" -Recurse | Where-Object {
}

Copy-Item -Recurse -Force "user_data" "TournamentStreamHelper\user_data"
Copy-Item -Recurse -Force "stage_strike_app" "TournamentStreamHelper\stage_strike_app"
Copy-Item -Recurse -Force "stage_strike_app\build" "TournamentStreamHelper\stage_strike_app\build"
Copy-Item -Force "LICENSE" "TournamentStreamHelper\LICENSE"
Copy-Item -Force "TSH.exe" "TournamentStreamHelper\TSH.exe"

Expand Down
25 changes: 16 additions & 9 deletions scripts/gen_release.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
#!/bin/bash

pushd ..
pushd .. > /dev/null

# Create TSH dir and its stage_strike_app folders
mkdir -p TournamentStreamHelper/stage_strike_app/build

mkdir TournamentStreamHelper
cp -R assets \
layout \
user_data \
LICENSE \
TSH.exe \
TournamentStreamHelper/

zip -rv \
release.zip \
TournamentStreamHelper \
-x \
"TournamentStreamHelper/assets/versions.json" \
"TournamentStreamHelper/assets/contributors.txt" \
cp -R stage_strike_app/build \
TournamentStreamHelper/stage_strike_app/

rm -rf \
TournamentStreamHelper/assets/versions.json \
TournamentStreamHelper/assets/contributors.txt \
TournamentStreamHelper/layout/game_images \
TournamentStreamHelper/layout/game_screenshots

zip -rv release-windows.zip TournamentStreamHelper

rm -rf TournamentStreamHelper
popd

popd > /dev/null
4 changes: 0 additions & 4 deletions src/TSHWebServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from flask_socketio import SocketIO, emit
import orjson
from loguru import logger
from .Helpers.TSHDirHelper import TSHResolve
from .TSHWebServerActions import WebServerActions
from .TSHScoreboardManager import TSHScoreboardManager
from .TSHTournamentDataProvider import TSHTournamentDataProvider
Expand Down Expand Up @@ -478,9 +477,6 @@ def ws_set_tournament(message):
def test(filename):
try:
filename = filename or 'stage_strike_app/build/index.html'
if filename.startswith('stage_strike_app/build/'):
return send_from_directory(TSHResolve('.'), filename, as_attachment=filename.endswith('.gz'))

return send_from_directory(os.path.abspath('.'), filename, as_attachment=filename.endswith('.gz'))
except Exception as e:
logger.error(f"File not found: {e}")
Expand Down

0 comments on commit c7a0925

Please sign in to comment.