Skip to content

Commit

Permalink
Merge branch 'main' into feat/linter-github-action
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon committed Apr 19, 2022
2 parents 543342b + 0f35071 commit 5a1379d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion 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-packagexml-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 @@ -83,7 +84,7 @@ Have a look at this post on the Salesforce Developers Blog to dive into it: [Opt

If you are not a Salesforce Architect or Developer, probably not, _sorry_.

If you are a Technical Architect or Developer, then it’s a very useful tool for you, when meting 3 conditions below:
If you are a Technical Architect or Developer, then it’s a very useful tool for you, when meeting the 3 conditions below:

1. Your Salesforce project uses a git repo as the source of truth.
2. You use the Source (DX) format in the repo.
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

0 comments on commit 5a1379d

Please sign in to comment.