Skip to content

Commit

Permalink
Added a new bash script to automate setting up a new dev scratch org
Browse files Browse the repository at this point in the history
  • Loading branch information
jongpie committed Aug 23, 2024
1 parent 5ab94f5 commit 109ea7d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/data/create-sample-log-entries.apex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ Logger.getUserSettings().IsDataMaskingEnabled__c = true;
Schema.User currentUser = [SELECT Id, Name, Username, Profile.Name FROM User WHERE Id = :System.UserInfo.getUserId()];
currentUser.AboutMe = 'I hope you dont leak my social, which is 400-11-9999, btw.';

new ExampleClassWithComplexLogging().doSomething();
try {
new ExampleClassWithLogging().doSomething();
} catch(Exception ex) {
Logger.warn('Something broke', ex);
}

// Logger.error('Example ERROR entry', new DmlException('fake DML exception')).addTag('some important tag');
Logger.error('Here is my fake Visa credit card 4000-1111-2222-0004, please don\'t steal it').addTag('data masking rule').addTag('credit card masking');
Expand Down
19 changes: 19 additions & 0 deletions scripts/dev/setup-dev-scratch-org.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

SCRATCH_ORG_ALIAS="$1"

sf org create scratch --definition-file ./config/scratch-orgs/dev-scratch-def.json --alias $SCRATCH_ORG_ALIAS --duration-days 30 --set-default --json
wait

sf project deploy start -c
wait

npm run permset:assign:all
wait

sf apex run --file ./scripts/data/create-sample-log-entries.apex
wait

# These 2 commands require https://github.com/jamessimone/sf-trace-plugin
sf apex trace
sf lightning debug

0 comments on commit 109ea7d

Please sign in to comment.