Skip to content

fix: rewrite shell scripts to Node.js for cross-platform compatibility#4

Open
doggy8088 wants to merge 1 commit intogemini-cli-extensions:mainfrom
doggy8088:main
Open

fix: rewrite shell scripts to Node.js for cross-platform compatibility#4
doggy8088 wants to merge 1 commit intogemini-cli-extensions:mainfrom
doggy8088:main

Conversation

@doggy8088
Copy link

Fixes #3 - Windows PowerShell cannot execute .sh scripts without additional tools like Git Bash, WSL, or Cygwin.

Changes:

  • Convert hooks/stop-hook.sh to hooks/stop-hook.js
  • Convert scripts/cancel.sh to scripts/cancel.js
  • Convert scripts/setup.sh to scripts/setup.js
  • Convert tests/hook_test.sh to tests/hook_test.js
  • Convert tests/setup_test.sh to tests/setup_test.js
  • Update hooks/hooks.json to reference stop-hook.js
  • Update commands/ralph/cancel.toml to use node with cancel.js
  • Update commands/ralph/loop.toml to use node with setup.js
  • Update README.md to reflect new .js file references

All scripts now use Node.js built-in modules (fs, path, child_process) with no external dependencies, ensuring compatibility across Windows, macOS, and Linux platforms.

Fixes gemini-cli-extensions#3 - Windows PowerShell cannot execute .sh scripts without additional
tools like Git Bash, WSL, or Cygwin.

Changes:
- Convert hooks/stop-hook.sh to hooks/stop-hook.js
- Convert scripts/cancel.sh to scripts/cancel.js
- Convert scripts/setup.sh to scripts/setup.js
- Convert tests/hook_test.sh to tests/hook_test.js
- Convert tests/setup_test.sh to tests/setup_test.js
- Update hooks/hooks.json to reference stop-hook.js
- Update commands/ralph/cancel.toml to use node with cancel.js
- Update commands/ralph/loop.toml to use node with setup.js
- Update README.md to reflect new .js file references

All scripts now use Node.js built-in modules (fs, path, child_process)
with no external dependencies, ensuring compatibility across Windows,
macOS, and Linux platforms.
@evanotero
Copy link
Contributor

What are your thoughts on how pickle rick does this by creating ps1 equivalents to all bash scripts. I see the PRO as not relying on the user having nodejs intalled. The CON is duplicative scripts and having to do routing. https://github.com/galz10/pickle-rick-extension/tree/main/scripts

@doggy8088
Copy link
Author

doggy8088 commented Feb 2, 2026

I see here: https://github.com/galz10/pickle-rick-extension/blob/main/hooks/hooks.json

This is still assuming the user has installed Python, but there are still people who may not install Python.

It looks like the Hooks in Gemini CLI don’t set up different scripts based on OS differences, right?

@Csaba8472
Copy link

What are your thoughts on how pickle rick does this by creating ps1 equivalents to all bash scripts. I see the PRO as not relying on the user having nodejs intalled. The CON is duplicative scripts and having to do routing. https://github.com/galz10/pickle-rick-extension/tree/main/scripts

isn't nodejs a pre-requisite? so relying on nodejs isn't a new dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PowerShell (pwsh) unable to run hooks/stop-hook.sh on Windows

3 participants