Achieve “npm run x” behavior without a “scripts” entry?

Note: This answer addresses the OP’s specific use case: calling the CLIs of dependent packages in the context of a given project; it is not about making CLIs globally available – see bottom for a discussion. tl;dr: On Unix-like platforms, prepend npm run env — to your command; e.g.: npm run env — mocha –recursive … Read more

.NET 6.0 C# “new console template” – how to read CLI arguments?

You can access the command line arguments from anywhere in your code using the Environment class. In particular, you can use Environment.GetCommandLineArgs: string name = Environment.GetCommandLineArgs()[1]; Console.WriteLine($”Hello, {name}!”); Note that the first element in the array contains the path of the executable and the arguments passed to the program start with the second element, i.e. … Read more

‘git log’ output encoding issues in Windows 10 CLI terminal

Okay, I experimented a bit and found out that Windows Git commands actually need UNIX variables like LC_ALL in order to display Polish (or other UTF-8 characters) correctly. Just try this command: set LC_ALL=C.UTF-8 Then enjoy the result. Here is what happened on my console (font “Consolas”, no chcp necessary): Update: Well, in order for … Read more