More specifically, I want every new SFDX project to include a ".scripts/" directory, populated with pre-written scripts (for deployments, data transformation, whatever).

Another use-case could be pre-set data-load scripts and files.

How do I do that? Mod some config files? Add a JavaScript or PowerShell On-Load/On-Complete hook?

  • So now there is a ./scripts directory created by default in sfdx projects.. nice. To populate it, i think i'll just write a powershell function and invoke it manually from within the project after creating it, to add the scripts I want. – Kirill Yunussov Jun 6 at 19:11

There is a promising -t TEMPLATE parameter to the sfdx force:project:create command, but it only supports two pre-defined values, standard and empty. There doesn't seem to be a way to build and pass custom templates.

I think it would be simplest to wrap the sfdx command in a shell script that passes parameters through and then does the additional work you want to do. You could also explore creating a CLI plugin.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.