After upgrading to 7.1.0, zx start powershell as shell instead of Bash
See original GitHub issueExpected Behavior
run Bash as shell
we share the project between Windows, MacOs and Linux platforms, and we can’t write scripts for Windows and Linux separately (we have a lot of them)!
Actual Behavior
starts powerShell instead
Steps to Reproduce the Problem
- write code
import { $ } from 'zx/core';
await $`rm -rf ./dist/client/assets.json`;
- run the code
zx script.mjs
- get the error
$ yarn zx ./script.mjs
yarn run v1.22.15
$ D:\Projects\raketa\raketa-web-app-boilerplate\node_modules\.bin\zx ./script.mjs
$ rm -rf ./dist/client/assets.json
Remove-Item : A parameter cannot be found that matches parameter name 'rf'.
At line:1 char:4
+ rm -rf ./dist/client/assets.json
+ ~~~
+ CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
Error: Remove-Item : A parameter cannot be found that matches parameter name 'rf'.
At line:1 char:4
+ rm -rf ./dist/client/assets.json
+ ~~~
+ CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
at file:///D:/Projects/raketa/raketa-web-app-boilerplate/script.mjs:3:8
exit code: 1
while with zx@7.0.8 everything works well
$ yarn run v1.22.15
$ D:\Projects\raketa\raketa-web-app-boilerplate\node_modules\.bin\zx ./script.mjs
$ rm -rf ./dist/client/assets.json
Done in 1.11s.
Specifications
- Version: 7.1.0
- Platform: Windows 10
Issue Analytics
- State:
- Created a year ago
- Comments:20
Top Results From Across the Web
Issues · google/zx - GitHub
Contribute to google/zx development by creating an account on GitHub. ... After upgrading to 7.1.0, zx start powershell as shell instead of Bash....
Read more >Migrating from Windows PowerShell 5.1 to PowerShell 7
Update from PowerShell 5.1 to PowerShell 7 for your Windows ... A PowerShell profile is a script that executes when PowerShell starts.
Read more >Install PowerShell on Linux - Microsoft Learn
Learn about the Linux distributions supported by PowerShell.
Read more >Installing PowerShell on macOS - Microsoft Learn
After the package is installed, run pwsh from a terminal. Before installing, check the list of Supported versions below. Note. PowerShell ...
Read more >Installing PowerShell on Windows - Microsoft Learn
PowerShell 7.3 is an in-place upgrade that replaces PowerShell 7.0 and lower. ... You can start PowerShell from a new shell by typing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
in every script write by hand
Fix https://github.com/google/zx/actions/runs/3202574452/jobs/5231685644
Try it: