Skip to content

Commit

Permalink
PR review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Prouvot committed Apr 14, 2022
1 parent 909f37a commit 13480a7
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- [Explicitly including specific files for inclusion or destruction regardless of diff:](#explicitly-including-specific-files-for-inclusion-or-destruction-regardless-of-diff)
- [Scoping delta generation to a specific folder](#scoping-delta-generation-to-a-specific-folder)
- [Generate a comma-separated list of the added and modified Apex classes:](#generate-a-comma-separated-list-of-the-added-and-modified-apex-classes)
- [Condition deployment on package.xml and destructiveChange content:](#condition-deployment-on-package.xml-and-destructiveChange-content)
- [Use the module in your own node application](#use-the-module-in-your-own-node-application)
- [Changelog](#changelog)
- [Built With](#built-with)
Expand Down Expand Up @@ -436,6 +437,22 @@ To cover this need, parse the content of the package.xml file produced by SGD us

`xq . < package/package.xml | jq '.Package.types | [.] | flatten | map(select(.name=="ApexClass")) | .[] | .members | [.] | flatten | map(select(. | index("*") | not)) | unique | join(",")'`

### Condition deployment on package.xml and destructiveChange content

SGD does not always generate content in the package.xml (or destructiveChanges.xml). Sometimes the commit range contains changes only within files to ignore (using .sgdignore and `--i` parameter).
[Deploying empty package.xml can lead to deployment errors.](https://github.com/scolladon/sfdx-git-delta/issues/249)
To avoid starting a failing deployment, test files content before execution:

```sh
# run deploy command only if the generated package contains metadata
if grep -q '<types>' ./package/package.xml ; then
echo "---- Deploying added and modified metadata ----"
sfdx force:source:deploy -x package/package.xml
else
echo "---- No changes to deploy ----"
fi
```

### Use the module in your own node application

If you want to embed sgd in your node application, install it has a dependency for your application
Expand Down Expand Up @@ -467,22 +484,6 @@ console.log(JSON.stringify(work))
*/
```

### Condition deployment on package.xml and destructiveChange content

SGD does not always generate content in the package.xml (or destructiveChanges.xml). Sometimes the commit range contains changes only within files to ignore (using .sgdignore and `--i` parameter).
[Deploying empty package.xml can lead to deployment errors.](https://github.com/scolladon/sfdx-git-delta/issues/249)
To avoid starting a failing deployment, test files content before execution:

```sh
# run deploy command only if the generated package contains metadata
if grep -q '<types>' ./package/package.xml ; then
echo "---- Deploying added and modified metadata ----"
sfdx force:source:deploy -x package/package.xml
else
echo "---- No changes to deploy ----"
fi
```

## Changelog

[changelog.md](/CHANGELOG.md) is available for consultation.
Expand Down

0 comments on commit 13480a7

Please sign in to comment.