From 166fa71f7eff750b2c1839026e739627b95a4425 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Mon, 25 Nov 2024 14:20:50 -0500 Subject: [PATCH] Add nightly link in about section (#4548) * Add nightly link in about sectoin * Add nightly detection * Lint * Change APP_NAME to PACKAGE_NAME * To be improved: working implementation on mac for click to download * Revert "To be improved: working implementation on mac for click to download" This reverts commit 7ced32a533b301b54c11776bf62c5bc18b053021. * Nevermind, will process on the website --- scripts/flip-files-to-nightly.sh | 3 ++- src/components/Settings/AllSettingsFields.tsx | 18 +++++++++++++++++- src/routes/Settings.tsx | 4 ++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/scripts/flip-files-to-nightly.sh b/scripts/flip-files-to-nightly.sh index 7b054a8c05..7ed512e010 100755 --- a/scripts/flip-files-to-nightly.sh +++ b/scripts/flip-files-to-nightly.sh @@ -5,7 +5,8 @@ export COMMIT=$(git rev-parse --short HEAD) # package.json yarn files:set-version -echo "$(jq --arg name 'Zoo Modeling App (Nightly)' '.productName=$name' package.json --indent 2)" > package.json +PACKAGE=$(jq '.productName="Zoo Modeling App (Nightly)" | .name="zoo-modeling-app-nightly"' package.json --indent 2) +echo "$PACKAGE" > package.json # electron-builder.yml yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/nightly"' electron-builder.yml diff --git a/src/components/Settings/AllSettingsFields.tsx b/src/components/Settings/AllSettingsFields.tsx index 97e6c9d9f0..b64e8aab0d 100644 --- a/src/components/Settings/AllSettingsFields.tsx +++ b/src/components/Settings/AllSettingsFields.tsx @@ -13,7 +13,7 @@ import { isDesktop } from 'lib/isDesktop' import { ActionButton } from 'components/ActionButton' import { SettingsFieldInput } from './SettingsFieldInput' import toast from 'react-hot-toast' -import { APP_VERSION } from 'routes/Settings' +import { APP_VERSION, PACKAGE_NAME } from 'routes/Settings' import { PATHS } from 'lib/paths' import { createAndOpenNewTutorialProject, @@ -264,6 +264,22 @@ export const AllSettingsFields = forwardRef( , and start a discussion if you don't see it! Your feedback will help us prioritize what to build next.

+ {PACKAGE_NAME.indexOf('-nightly') === -1 && ( +

+ Want to experience the latest and (hopefully) greatest from our + main development branch?{' '} + + Click here to grab Zoo Modeling App (Nightly) + + . It can be installed side-by-side with the stable version + you're running now. But careful there, a lot less testing is + involved in their release 🤖. +

+ )} diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index 3c3f853e0e..d83b18b9e2 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -26,6 +26,10 @@ export const APP_VERSION = window.electron.packageJson.version : 'main' +export const PACKAGE_NAME = isDesktop() + ? window.electron.packageJson.name + : 'zoo-modeling-app' + export const Settings = () => { const navigate = useNavigate() const [searchParams, setSearchParams] = useSearchParams()