serverless / serverless-azure-functions

Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
MIT License
267 stars 162 forks source link

feat: Use cross-spawn instead of adding .cmd #434

Closed tbarlow12 closed 4 years ago

tbarlow12 commented 4 years ago

What did you implement:

Instead of manually checking for the operating system, this uses the well known package cross-spawn (142M downloads per month) to spawn the process across operating systems.

How did you implement it:

Replaced the call to child_process.spawn with cross-spawn.spawn. Also added jest-os-detection that will only test the spawn calls the way that they should be expected on that native os rather than defining a property on the process object

How can we verify it:

Run sls offline. It will spawn on any operating system. Run npm test on mac, linux or windows. You'll see that 8 tests are skipped on any OS (each OS has 4 tests)

Todos:

Note: Run npm run test:ci to run all validation checks on proposed changes

Is this ready for review?: YES Is it a breaking change?: NO

pjlittle commented 4 years ago

Looks good - much better way of handling OS matrix. 👍