unitysetup.powershell
unitysetup.powershell copied to clipboard
Refactor and migrate Confirm-UPMConfig into UnitySetup.powershell
Internally we've had a script called Confirm-UPMConfig for quite some time that provides the utility of scanning for all NPM packaging feeds used by a given Unity project and creating auth tokens for each of them, storing them in the user's .toml file.
This pull request migrates that functionality, to UnitySetup, allowing users to call Update-UPMConfig -ProjectManifestPath
Additionally there are a few structural changes incorporated here as the process is now 3 stages of logic in the code:
- Import-UPMConfig: Collects all of the scoped registries and entries in the existing .toml file and returns them
- Sync-UPMConfig: Looks at the registries listed and gets auth tokens for each, refreshing expired existing tokens if found, or adding new entries for new scoped registries.
- Export-UPMConfig: Writes out the UPM configuration to the .toml file (or creates it if one doesn't exist)
The logic is a bit clunky since Sync does most of the work here. Would appreciate feedback where applicable
This is almost done, but I'll need to move the dynamic install logic to the script leveraging this, and push another commit to fix a runtime error I'm seeing now (dropped a param during a refactor)