-
-
Couldn't load subscription status.
- Fork 1.3k
Create Edited StarryNight #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adds the StarryNight theme without changig the set up of your spotify.
WalkthroughAdds a Bash script that checks for Spicetify, locates the themes directory, ensures the StarryNight repo is present (cloning if absent), registers the theme with Spicetify without applying it, and prints manual application instructions. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Script as Install Script
participant Git as Git (StarryNight repo)
participant Spicetify as Spicetify CLI
User->>Script: Run installer
Script->>Spicetify: Check installation/version
Spicetify-->>Script: Present / Not found
alt Spicetify not found
Script-->>User: Exit with error message
else Spicetify present
Script->>Script: Determine themes directory & target path
Script->>Git: Clone StarryNight if not present
Git-->>Script: Repo cloned or already exists
Script->>Spicetify: Register StarryNight theme (no apply)
Script-->>User: Print manual apply instructions
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (4)
Edited StarryNight (4)
10-11: Improve path parsing robustness.The current approach using
sedto extract the themes directory is fragile and may fail if the config path format changes or contains unexpected characters.Apply this diff for more robust path handling:
-THEME_DIR="$(spicetify -c | sed 's/config.ini$/Themes/')" -STAR_NIGHT_DIR="${THEME_DIR}/StarryNight" +CONFIG_PATH="$(spicetify -c)" +if [[ -z "$CONFIG_PATH" || ! -f "$CONFIG_PATH" ]]; then + echo "Error: Could not locate Spicetify config file" + exit 1 +fi +THEME_DIR="$(dirname "$CONFIG_PATH")/Themes" +STAR_NIGHT_DIR="${THEME_DIR}/StarryNight"
10-11: Ensure themes directory exists before operations.The script assumes the Themes directory exists but doesn't verify or create it, which could cause failures.
Add this code after determining the THEME_DIR but before the git operations:
# Ensure the themes directory exists if [[ ! -d "$THEME_DIR" ]]; then if ! mkdir -p "$THEME_DIR"; then echo "Error: Could not create themes directory at $THEME_DIR" exit 1 fi echo "Created themes directory at $THEME_DIR" fiAlso applies to: 21-21
1-25: Consider adding script metadata and usage instructions.The script lacks documentation about its purpose, usage, and requirements.
Consider adding a header comment block:
#!/bin/bash # # StarryNight Theme Installer for Spicetify # # Description: Downloads and registers the StarryNight theme for Spicetify # without applying it, preserving current setup. # # Requirements: # - Spicetify must be installed and configured # - Git must be available # - Internet connection for theme download # # Usage: ./install-starrynight.sh #
16-16: Replace third‑party clone with canonical spicetify-themes or confirm MIT licenseStarryNight is included in spicetify/spicetify-themes (MIT); either update the clone to the canonical spicetify/spicetify-themes repo or verify b-chen00/StarryNight is the same code and explicitly MIT-licensed before keeping the current third‑party URL.
Location: Edited StarryNight — line 16 (
git clone https://github.com/b-chen00/StarryNight.git)
| @@ -0,0 +1,24 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add proper file extension and improve filename.
The filename "Edited StarryNight" lacks a proper extension and contains a space, which can cause issues in shell environments and version control systems.
Consider renaming to something like:
install-starrynight.sh
or
setup_starrynight_theme.sh
🤖 Prompt for AI Agents
In Edited StarryNight around lines 1 to 1, the filename contains a space and no
extension which can break shells and tooling; rename the file to a safe,
descriptive name with a .sh extension (for example install-starrynight.sh or
setup_starrynight_theme.sh), update any references to the old filename in
scripts/CI/docs, and ensure the file has executable permissions (chmod +x) so
the existing shebang works as expected.
| if [ -d "$STAR_NIGHT_DIR" ]; then | ||
| echo "StarryNight theme already exists at $STAR_NIGHT_DIR" | ||
| else | ||
| git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR" | ||
| echo "StarryNight theme downloaded to $STAR_NIGHT_DIR" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for git operations.
The script doesn't handle potential git clone failures, which could leave the installation in an inconsistent state.
Apply this diff to add proper error handling:
if [ -d "$STAR_NIGHT_DIR" ]; then
echo "StarryNight theme already exists at $STAR_NIGHT_DIR"
else
- git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"
- echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
+ if git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"; then
+ echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
+ else
+ echo "Error: Failed to download StarryNight theme"
+ exit 1
+ fi
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [ -d "$STAR_NIGHT_DIR" ]; then | |
| echo "StarryNight theme already exists at $STAR_NIGHT_DIR" | |
| else | |
| git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR" | |
| echo "StarryNight theme downloaded to $STAR_NIGHT_DIR" | |
| fi | |
| if [ -d "$STAR_NIGHT_DIR" ]; then | |
| echo "StarryNight theme already exists at $STAR_NIGHT_DIR" | |
| else | |
| if git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"; then | |
| echo "StarryNight theme downloaded to $STAR_NIGHT_DIR" | |
| else | |
| echo "Error: Failed to download StarryNight theme" | |
| exit 1 | |
| fi | |
| fi |
| fi | ||
|
|
||
| # Register theme in Spicetify (but do not apply) | ||
| spicetify config current_theme StarryNight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for spicetify configuration.
The script doesn't verify if the spicetify config command succeeds, which could lead to silent failures.
Apply this diff to add error checking:
-spicetify config current_theme StarryNight
+if ! spicetify config current_theme StarryNight; then
+ echo "Error: Failed to register StarryNight theme with Spicetify"
+ exit 1
+fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| spicetify config current_theme StarryNight | |
| if ! spicetify config current_theme StarryNight; then | |
| echo "Error: Failed to register StarryNight theme with Spicetify" | |
| exit 1 | |
| fi |
🤖 Prompt for AI Agents
In Edited StarryNight around line 21, the spicetify config command is run
without checking its result; update the script to run the command and
immediately verify its exit status (e.g., using if ! spicetify config
current_theme StarryNight; then echo an error to stderr including the command
and exit with non‑zero status) so failures are reported and the script stops on
error.
Adds the StarryNight theme without changig the set up of your spotify.
Summary by CodeRabbit