What are the available values for workspaceElement state in CLI Hooks?

Looking at the doc for CLI Hooks, some hook types like predeploy and postsourceupdate return a workspaceElement.

This element contains a state property that contains only one character, that I assume means the following:

  • c: changed
  • d: deleted
  • n: new

Is this documented anywhere ?
I assume that having this documented would make sense.
I would be sure not to miss any value, and having a documentation would make it less prone to be changed without notice.


From the Source code, you can view here

The state field maps to one of these, It’s the state of the local file when force source pull or push occurs.

  • UNCHANGED: ‘u’

  • CHANGED: ‘c’

  • DELETED: ‘d’

  • NEW: ‘n’

  • DUP: ‘p’

The DUP can be generated when mdapi covert happens and two files with the same name exist. The documented use case is discussed here

This is not documented and can be improved. Will Share the feedback internally.

The source code will go open source and these flags will become obvious then.

Source : Link , Question Author : Fabien Taillon , Answer Author : Mohith Shrivastava

Leave a Comment