Skip to content

Commit 29f22f1

Browse files
committed
fix: correctly handle cases when user.js does not exist
1 parent dc0a47d commit 29f22f1

File tree

5 files changed

+372
-127
lines changed

5 files changed

+372
-127
lines changed

.github/demo.tape

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Set Theme "Catppuccin Macchiato"
1616

1717
Hide
1818

19-
Type@0 'set -x NYOOM_TEMP_CONFIG "$(mktemp -d)/nyoom.toml"' Enter Sleep 1s
20-
Type@0 'set -x NYOOM_TEMP_PROFILE "$(mktemp -d)"' Enter Sleep 1s
19+
Type@0 'set nyoom_temp_config "$(mktemp -d)/nyoom.toml"' Enter Sleep 1s
20+
Type@0 'set nyoom_temp_profile "$(mktemp -d)"' Enter Sleep 1s
2121

22-
Type@0 'touch "$NYOOM_TEMP_PROFILE/user-overrides.js"' Enter Sleep 1s
23-
Type@0 'touch "$NYOOM_TEMP_PROFILE/user.js"' Enter Sleep 1s
24-
Type@0 'echo "#!/bin/sh" > "$NYOOM_TEMP_PROFILE/updater.sh" && chmod +x "$NYOOM_TEMP_PROFILE/updater.sh"' Enter Sleep 1s
25-
Type@0 'echo "#!/bin/sh" > "$NYOOM_TEMP_PROFILE/prefsCleaner.sh" && chmod +x "$NYOOM_TEMP_PROFILE/prefsCleaner.sh"' Enter Sleep 1s
22+
Type@0 'touch "$nyoom_temp_profile/user-overrides.js"' Enter Sleep 1s
23+
Type@0 'touch "$nyoom_temp_profile/user.js"' Enter Sleep 1s
24+
Type@0 'echo "#!/bin/sh" > "$nyoom_temp_profile/updater.sh" && chmod +x "$nyoom_temp_profile/updater.sh"' Enter Sleep 1s
25+
Type@0 'echo "#!/bin/sh" > "$nyoom_temp_profile/prefsCleaner.sh" && chmod +x "$nyoom_temp_profile/prefsCleaner.sh"' Enter Sleep 1s
2626

27-
Type@0 'alias nyoom="./target/release/nyoom -c $NYOOM_TEMP_CONFIG"' Enter Sleep 1s
27+
Type@0 'alias nyoom="./target/release/nyoom -c $nyoom_temp_config"' Enter Sleep 1s
2828
Type@0 'alias ls="eza" cat="bat --style=plain"' Enter Sleep 1s
29-
Type@0 'nyoom profile "$NYOOM_TEMP_PROFILE"' Enter Sleep 1s
29+
Type@0 'nyoom profile "$nyoom_temp_profile"' Enter Sleep 1s
3030

3131
Type@0 'fish_config theme choose "Catppuccin Macchiato"' Enter Sleep 1s
3232
Type@0 'set fish_autosuggestion_enabled 0' Enter Sleep 1s
@@ -76,7 +76,7 @@ Sleep 10s
7676
Screenshot .github/demo.png
7777

7878
Hide
79-
Type 'cd "$NYOOM_TEMP_PROFILE"' Enter
79+
Type 'cd "$nyoom_temp_profile"' Enter
8080
Type 'clear' Enter
8181
Sleep 1s
8282
Show
@@ -88,4 +88,4 @@ Type 'cat user-overrides.js' Sleep 500ms Enter
8888
Sleep 10s
8989

9090
Hide
91-
Type 'rm -rf "$NYOOM_TEMP_PROFILE" "$NYOOM_TEMP_CONFIG"' Enter
91+
Type 'rm -rf "$nyoom_temp_profile" "$nyoom_temp_config"' Enter

0 commit comments

Comments
 (0)