Skip to content

Incorrectly escaped script command #135

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

Closed
Tikkoneus opened this issue Sep 14, 2023 · 0 comments
Closed

Incorrectly escaped script command #135

Tikkoneus opened this issue Sep 14, 2023 · 0 comments

Comments

@Tikkoneus
Copy link

Tikkoneus commented Sep 14, 2023

Hello! My apologies, I'm waaaaay out of my depth so please pardon my ignorance.

When using rails new foobar -j esbuild --css bootstrap to initialize a new rails 7.0.8 app I receive:

Add watch:css script
         run  npm pkg set scripts.watch:css="nodemon --watch ./app/assets/stylesheets/ --ext scss --exec "yarn build:css"" from "."
npm ERR! code EUSAGE
npm ERR!
npm ERR! npm pkg set expects a key=value pair of args.
npm ERR!
npm ERR! Manages your package.json
npm ERR!
npm ERR! Usage:
npm ERR! npm pkg set <key>=<value> [<key>=<value> ...]
npm ERR! npm pkg get [<key> [<key> ...]]
npm ERR! npm pkg delete <key> [<key> ...]
npm ERR! npm pkg set [<array>[<index>].<key>=<value> ...]
npm ERR! npm pkg set [<array>[].<key>=<value> ...]
npm ERR! npm pkg fix
npm ERR!
npm ERR! Options:
npm ERR! [-f|--force] [--json]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces]
npm ERR!
npm ERR! Run "npm help pkg" for more info

This appears to be from the nested double quotes. By hand-editing
vendor/bundle/ruby/3.2.0/gems/cssbundling-rails-1.3.2/lib/install/bootstrap/install.rb
and changing line 25 from:
add_package_json_script("watch:css", "nodemon --watch ./app/assets/stylesheets/ --ext scss --exec \"#{bundler_run_cmd } build:css\"", false)
to
add_package_json_script("watch:css", "nodemon --watch ./app/assets/stylesheets/ --ext scss --exec '#{bundler_run_cmd } build:css'", false)
The error goes away. (Changed the escaped double-quotes to single quotes.)

System information:

Ubuntu 22.04.3 LTS \n \l
Linux 5.15.90.1-microsoft-standard-WSL2
node v20.6.1
npm  v9.8.1
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

No branches or pull requests

2 participants