refactor: deduplicate hardcoded version strings - #50
Closed
wasim-builds wants to merge 8 commits into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #19 by making macos/VERSION the single source of truth for the Dream Skin Studio version, removing duplicated hardcoded version strings and reading the version dynamically during build/runtime.
Changes:
- Read
SKIN_VERSIONfrommacos/VERSIONin the injector and shared macOS shell helpers instead of hardcoding1.1.2. - Update macOS tests and client release packaging text to reference
macos/VERSION. - Remove the hardcoded
"version"field frommacos/package.json.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| macos/tests/run-tests.sh | Updates version assertions to be derived from macos/VERSION. |
| macos/scripts/injector.mjs | Loads SKIN_VERSION from macos/VERSION at runtime. |
| macos/scripts/common-macos.sh | Sets SKIN_VERSION by reading macos/VERSION for shared scripts. |
| macos/scripts/build-client-release.sh | Uses macos/VERSION when generating client-facing instructions text. |
| macos/package.json | Removes hardcoded package version to avoid duplication. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| EXPECTED_BUNDLE="/Applications/Codex \$(touch \"$STATE_EVAL_MARKER\").app" | ||
| EXPECTED_EXE="$EXPECTED_BUNDLE/Contents/MacOS/ChatGPT; touch \"$STATE_EVAL_MARKER\"" | ||
| EXPECTED_VERSION='1.1.2 "nightly"' | ||
| EXPECTED_VERSION="$(/bin/cat "$ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\\n\\r') \\"nightly\\"" |
| /usr/bin/cmp -s "$NO_DESKTOP_CONFIG" "$TMP/original-without-desktop.toml" | ||
|
|
||
| /usr/bin/env -u HOME /bin/bash -c '. "$1/scripts/common-macos.sh"; [ -n "$HOME" ] && [ "$SKIN_VERSION" = "1.1.2" ]' _ "$ROOT" | ||
| /usr/bin/env -u HOME /bin/bash -c '. "$1/scripts/common-macos.sh"; [ -n "$HOME" ] && [ "$SKIN_VERSION" = "$(/bin/cat "$ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\''\n\r'\'')" ]' _ "$ROOT" |
| INJECTOR_JOB_LABEL="com.openai.codex-dream-skin-studio.injector" | ||
| EXPECTED_CODEX_TEAM_ID="${CODEX_EXPECTED_TEAM_ID:-2DC432GLL2}" | ||
| SKIN_VERSION="1.1.2" | ||
| SKIN_VERSION="$(/bin/cat "$PROJECT_ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\\n\\r')" |
|
|
||
| /usr/bin/printf '%s\n' \ | ||
| 'Codex 主题编辑器 1.1.2' \ | ||
| 'Codex 主题编辑器 '"$(/bin/cat "$ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\\n\\r')" \\ |
18 tasks
Owner
|
Thanks for this! Main now sources the version from a single 感谢!main 现在统一从单一的 VERSION 文件读取版本号,已经覆盖了这个 PR 的目标。先关闭,谢谢你的investigate! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19. Made
macos/VERSIONthe single source of truth. Read the version string dynamically during build/runtime from this file instead of hardcoding1.1.2across multiple files. Also removed the hardcoded version frompackage.json.