From 4f10c2494f8a7736dfd1068ca486e9af5d96504e Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:31:31 +0100 Subject: [PATCH] test --- .github/workflows/deploy.yml | 1 + scripts/build-front.sh | 20 ++++++++++++++++++++ webapp/package.json | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 09535d94b9..0b5a2a2fb4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,7 @@ on: branches: - "master" - "hotfix/**" + - "feature/test_desktop" jobs: binary: diff --git a/scripts/build-front.sh b/scripts/build-front.sh index fce9cb7e0a..69922a04cf 100755 --- a/scripts/build-front.sh +++ b/scripts/build-front.sh @@ -5,7 +5,27 @@ set -e CURR_DIR=$(cd "$(dirname "$0")" && pwd) cd "$CURR_DIR"/../webapp + +# shellcheck disable=SC2016 +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's|"homepage".*|"homepage": "/static",|g' package.json + sed -i '' 's|loadPath.*|loadPath: `/static/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +else + sed -i 's|"homepage".*|"homepage": "/static",|g' package.json + sed -i 's|loadPath.*|loadPath: `/static/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +fi + npm run build + +# shellcheck disable=SC2016 +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's|"homepage".*|"homepage": "/",|g' package.json + sed -i '' 's|loadPath.*|loadPath: `/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +else + sed -i 's|"homepage".*|"homepage": "/",|g' package.json + sed -i 's|loadPath.*|loadPath: `/locales/{{lng}}/{{ns}}.json?v=${version}`,|g' src/i18n.ts +fi + cd .. rm -fr resources/webapp cp -r ./webapp/dist/ resources/webapp diff --git a/webapp/package.json b/webapp/package.json index c4ec8e33c1..661d1fc2f1 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -2,9 +2,10 @@ "name": "antares-web", "version": "2.16.3", "private": true, + "homepage": "/", "type": "module", "scripts": { - "build": "tsc && vite build", + "build": "tsc && vite build --base=./", "clean": "rm -rf dist node_modules/.vite", "dev": "vite", "lint": "tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives",