microsoft/just

No example on command line commands

Closed this issue · 4 comments

There is no clear example on how to create a task that executes a command line command.

For example how would you execute a task that starts with "ng build" and then runs some other command line task.

Do you mean how to run this thing like

ng build

Which would translate to build -> tsc, webpack etc? I think that is the point of this document page:
https://microsoft.github.io/just/docs/doc-start.html

I actually am not familiar with how ng command line works but if you stick with the doc there, you would see that there's not a need to call ng. just would take over the build command... does that make sense?

Not really what i mean.
What i mean is to integrate command line commands execution in the tasks, something like what https://www.npmjs.com/package/gulp-shell is doing ?

beary commented

Maybe this?

const { task } = require('just-task')
const { exec } = require('just-scripts-utils')

task('build', () => {
  return exec('echo "hello world!"', {
    stderr: process.stderr,
    stdout: process.stdout
  })
})
$ npx just build

[5:39:55 PM] ■ started 'build'
hello world!
[5:39:55 PM] ■ finished 'build' in 0.01s

This should be placed in the document.

Issues seem to have gone stale.