Skip to content

Commit d9a36c9

Browse files
committed
I wish i knew what a statement was
1 parent 1d94f7d commit d9a36c9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.bashrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,12 +1225,12 @@ lbl() {
12251225
fi
12261226
}
12271227

1228-
# Execute an apex statement against an environment
1228+
# Execute an apex expression against an environment
12291229
exp() {
12301230
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
1231-
echo "Execute an expression, and print the output. Takes the apex statement you pass in and wraps it in a System.debug() call."
1231+
echo "Execute an expression, and print the output. Takes the apex expression you pass in and wraps it in a System.debug() call."
12321232
echo "Pass quiet or q as the last paremeter to supress notification messages"
1233-
echo "Usage: exp [ORG_ID] [STATEMENT_TO_EVALUATE] ['quiet' | 'q']"
1233+
echo "Usage: exp [ORG_ID] [EXPRESSION_TO_EVALUATE] ['quiet' | 'q']"
12341234
return 1
12351235
fi
12361236

@@ -1253,12 +1253,13 @@ exp() {
12531253
# We need to find from the start of USER_DEBUG to the next non-debug line.
12541254
# Notice "b" is put on a line by itself, making it tricky to include in output
12551255

1256-
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<"$apexCommand" | # Execute the statement inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
1256+
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<"$apexCommand" | # Execute the expression inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
12571257
pcregrep -M 'USER_DEBUG(.|\n)+?([\d]{2}:[\d]{2}:[\d]{2})' | # find debug line, and try to search up to the next apex ouptut line, starting with dd:dd:dd
12581258
sed '$d' | # remove the last line, which is the first non-debug line
12591259
sed 's/.*\|//' # find everything after the last pipe, which will be the debugged output
12601260
}
12611261

1262+
# Execute an apex expression against an environment
12621263
stmt() {
12631264
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
12641265
echo "Execute a statement or list of statements"

0 commit comments

Comments
 (0)