-
-
Notifications
You must be signed in to change notification settings - 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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # 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 commentThe 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| echo "StarryNight theme installed and registered." | ||||||||||||||||||||||||||||||||||
| echo "Your Spotify setup remains unchanged. To use the theme, run 'spicetify apply'." | ||||||||||||||||||||||||||||||||||
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:
or
🤖 Prompt for AI Agents