Skip to content

Conversation

@brandenrodgers
Copy link
Contributor

Description and Context

An initial pass at supporting project profiles. Depends on some changes to the project parsing lib.

Screenshots

TODO

Who to Notify

logProfileFooter(profile);
} else {
// A profile must be specified if this project has profiles configured
await exitIfUsingProfiles(projectConfig, projectDir);
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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);
Copy link
Contributor Author

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(
Copy link
Contributor Author

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.

@brandenrodgers brandenrodgers merged commit f451ae2 into main May 19, 2025
1 check passed
@brandenrodgers brandenrodgers deleted the br/support-project-profiles branch May 19, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants