Skip to content

Commit

Permalink
docs: update from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon committed Jun 14, 2021
1 parent 4911368 commit dbf6e9f
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ Generate the sfdx content in source format and destructive change from two git c
## TL;DR:

```sh
sfdx plugins:install sfdx-git-delta
```

```sh
sfdx plugins:install sfdx-git-delta
cd repo/path
mkdir output
sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output output
sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output "."
```

```sh
echo "--- package.xml generated with added and modified metadata ---"
cat output/package/package.xml
cat package/package.xml
echo
echo "---- Deploying added and modified metadata ----"
sfdx force:source:deploy -x output/package/package.xml
sfdx force:source:deploy -x package/package.xml
```

```sh
echo "--- destructiveChanges.xml generated with deleted metadata ---"
cat output/destructiveChanges/destructiveChanges.xml
cat destructiveChanges/destructiveChanges.xml
echo
echo "--- Deleting removed metadata ---"
sfdx force:mdapi:deploy -d output/destructiveChanges --ignorewarnings
sfdx force:mdapi:deploy -d destructiveChanges --ignorewarnings
```

## What is SFDX-Git-Delta?
Expand Down Expand Up @@ -91,15 +95,16 @@ If you encounter this issue while having installed the correct version of node o
## How to use it?

<!-- commands -->
* [`sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-o <filepath>] [-a <number>] [-d] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-sgdsourcedelta--f-string--t-string--r-filepath--i-filepath--d-filepath--o-filepath--a-number--d---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)

- [`sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-o <filepath>] [-a <number>] [-d] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-sgdsourcedelta--f-string--t-string--r-filepath--i-filepath--d-filepath--o-filepath--a-number--d---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)

## `sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-o <filepath>] [-a <number>] [-d] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Generate the sfdx content in source format and destructive change from two git commits

```
USAGE
$ sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-o <filepath>] [-a
$ sfdx sgd:source:delta -f <string> [-t <string>] [-r <filepath>] [-i <filepath>] [-D <filepath>] [-o <filepath>] [-a
<number>] [-d] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down Expand Up @@ -130,16 +135,13 @@ OPTIONS
```

_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v4.5.0/src/commands/sgd/source/delta.ts)_

<!-- commandsstop -->

### Important note for Windows users:

If you run SGD on a Windows system, make sure to use double quotes [to prevent the parameters from being interpreted by the terminal](https://github.com/scolladon/sfdx-git-delta/issues/134):

```sh
sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output .
```

## Scenario:

Let’s take a look at the following scenario:
Expand Down Expand Up @@ -293,12 +295,12 @@ To cover this requirement, you can use a tool such as [yq](https://github.com/ki

`xq . < package/package.xml | jq '.Package.types | if type=="array" then .[] else . end | select(.name=="ApexClass") | .members | join(",")'`

### Use the module in your own application
### Use the module in your own node application

Install it has a dependency for your application
If you want to embed sgd in your node application, install it has a dependency for your application

```sh
yarn add --dev sfdx-git-delta
yarn add sfdx-git-delta
```

Then use the javascript module
Expand Down

0 comments on commit dbf6e9f

Please sign in to comment.