Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Edited StarryNight
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
Copy link

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.


# Make sure Spicetify is installed
if ! command -v spicetify &> /dev/null; then
echo "Spicetify is not installed. Please install Spicetify first."
exit 1
fi

# Download StarryNight theme from GitHub
THEME_DIR="$(spicetify -c | sed 's/config.ini$/Themes/')"
STAR_NIGHT_DIR="${THEME_DIR}/StarryNight"

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
Comment on lines +13 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
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


# Register theme in Spicetify (but do not apply)
spicetify config current_theme StarryNight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
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.


echo "StarryNight theme installed and registered."
echo "Your Spotify setup remains unchanged. To use the theme, run 'spicetify apply'."