question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reliance on bash `rm` command breaks Windows

See original GitHub issue

The use of rm -fr lib/ as the first step within the test script of generated projects breaks on Windows. Whilst it is possible to work around this with some hackery (e.g. defining a different test script and using that), it would be nice to strip out the OS dependency.

I think the issue is here:

https://github.com/projen/projen/blob/e9ca1aa5d92fea64e16e4be8bc6b4a9fd3d2a662/src/typescript.ts#L306

We could do something like use https://github.com/shelljs/shx as a way of using portable Shell commands (I’m sure others may think of other options). Are there any objections to doing this please? If so, does the library get declared as a dependency of Projen, or a peer dependency?

I’m happy to submit a PR, but I want to make sure others are happy with this approach before I do.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
john-tippercommented, Feb 18, 2021

Yes, the reason I went with shx in #540 was because there are other breaking commands other than rm that are used with Projen, such as mv and mkdir.

1reaction
rpawlaszekcommented, Feb 18, 2021

I have the same issue on Windows with rm -fr. From my side the proposition is to use rimraf and have it as a global dependency for projen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run rm command on windows 10? - Stack Overflow
In order to run bash commands on Windows you need to install Bash complied for Windows. Install Cygwin and add bin directory to...
Read more >
Troubleshoot Start menu errors - Windows Client
Learn how to troubleshoot common Start menu errors in Windows 10. For example, learn to troubleshoot errors related to deployment, crashes, ...
Read more >
Text-Based Commands - Cornell Computer Science
... need to learn how to use your command shell. Command shells are operating system dependent. ... In Windows, the command shell is...
Read more >
Docker Compose release notes | Docker Documentation
Fixed the depends_on dependency recreation behavior. Fixed bash completion for the docker-compose build --memory command. Fixed the misleading environmental ...
Read more >
Windows Batch Scripting - Wikibooks
This book describes and shows how to use the Microsoft-supplied command interpreter cmd.exe and the associated commands, and how to write Windows batch ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found