I'm pulling down change sets into my IDE using sfdx force:source:retrieve -n 'my changeset name'
and it puts the files in a 'my changeset name'. Is there a way to specify the name of the folder, or automate the nameing with a date/time stamp?
2 Answers
Not directly in sfdx, no. The folder name is how the API determines which "package" (in your case, the change set) to update when you deploy. A simple shell script could do the trick though:
sfdx force:source:retrieve -n "my changeset name"
TEMPDATE=`date`
mkdir "$TEMPDATE"
mv "my changeset name" "$TEMPDATE"
Alternatively, consider using a git repository. This is more efficient in terms of disk space, and you pretty easily navigate your changes via branches/commits.
Currently, there is no such functionality to allow you to specify the directory where you want to retrieve it. It is hardcoded in the CLI code so if you need to enhance this, file an enhancement request here
I have built an sfdx plugin that allows for this flexibility. You can check here
To get started with this here is all you need to do,
sfdx plugins:install mo-dx-plugin
And then use the below command
sfdx retrieve:dxsource -n <package/changeset> -p <[pathName]>
use -p to specify the directory where you want to retrieve it.
-
3+1 Of course you'd have thought of this. I keep forgetting how absolutely awesome your plugin is.– sfdcfoxJun 5, 2020 at 14:31
-
2@sfdcfox Thank you 😊 . I will be updating some more security patch and fixes for it this weekend and excited about it. Should make apex saving much better especially during inserts :) Jun 5, 2020 at 14:32