-
Notifications
You must be signed in to change notification settings - Fork 72
Support project profiles #1520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support project profiles #1520
Conversation
| logProfileFooter(profile); | ||
| } else { | ||
| // A profile must be specified if this project has profiles configured | ||
| await exitIfUsingProfiles(projectConfig, projectDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all of the commands that leverage profiles. We will exit if you have profiles configured AND you don't specify a profile for the command. It has to be explicitly provided
| return false; | ||
| } | ||
|
|
||
| export function fileExists(_path: string): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some edits to this so I could use it in my new commands. I didn't want to include the logs. Nothing was calling this function except for checkAndConvertToJson so this should be a safe change. I tested it on the commands that use checkAndConvertToJson and everything seems to WAD
| let targetAccountId: number | undefined; | ||
|
|
||
| try { | ||
| const profileToRemove = loadHsProfileFile(projectSourceDir, profileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentionally not using loadProfile here because I don't want any of the logs if it fails to load. I'm loading it because it lets us prompt the user to remove the project from the account if we can find the accountId in it.
|
|
||
| if (profileToCopyVariablesFrom) { | ||
| try { | ||
| const profileToCopyFileContent = loadHsProfileFile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using loadProfile here because we don't want to log anything on errors. We'll make the variables section in the new config empty if this fails.
Description and Context
An initial pass at supporting project profiles. Depends on some changes to the project parsing lib.
Screenshots
TODO
Who to Notify