File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Validates all agent scripts (authoring bundles) in the project.
3+ # For each .agent file, runs: sf agent validate authoring-bundle -n <script-api-name>
4+ # where script-api-name is the file name without the .agent extension.
5+
6+ SCRIPT_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd -P)
7+ REPO_ROOT=" $SCRIPT_DIR /.."
8+ cd " $REPO_ROOT "
9+
10+ FAILED=0
11+ VALIDATED=0
12+
13+ echo " Validating agent scripts (authoring bundles)..."
14+ echo " "
15+
16+ while IFS= read -r -d ' ' agent_file; do
17+ script_name=$( basename " $agent_file " .agent)
18+ echo " Validating: $script_name "
19+ if sf agent validate authoring-bundle -n " $script_name " ; then
20+ (( VALIDATED++ ))
21+ else
22+ (( FAILED++ ))
23+ fi
24+ echo " "
25+ done < <( find force-app/main -name " *.agent" -type f -print0 | sort -z)
26+
27+ echo " ----------------------------------------"
28+ echo " Done: $VALIDATED passed, $FAILED failed"
29+
30+ if [[ $FAILED -gt 0 ]]; then
31+ exit 1
32+ fi
33+ exit 0
You can’t perform that action at this time.
0 commit comments