1. Home
  2. Docs
  3. Manual
  4. Playbook
  5. Command list
  6. LocalCommand component

LocalCommand component

This is the command interface for executing local terminals, which will exit terminal mode after each command execution is completed.
Because it is executed asynchronously, in order to facilitate collaboration with async/await, a JS interface with the same name but lowercase initial is encapsulated. The specific source code is as follows:
And its reference example:

The core code is as follows:

import LocalCommand 1.0

LocalCommand {
   id: local
   onDataArrived: {

asyncGenerator(function *(){
    Playbook.log("command start.")
    yield localCommand(local, cmd.text).catch(function(){})
    Playbook.log("command finish.")

The Property list is as follows:
QString command: [readable / writable], setting the commands to be executed.
Int lastExitCode: [readable], get the exit code at the end of the command’s final execution. Typically, an exit code of 0 is normal, while other values indicate exceptions.