Skip to content
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

fix: add deprecation warning #332

Merged
merged 2 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/commands/force/user/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ export class UserDisplayCommand extends SfdxCommand {
public static readonly examples = messages.getMessage('examples').split(os.EOL);
public static readonly requiresUsername = true;
public static readonly supportsDevhubUsername = true;
public static readonly deprecated = {
messageOverride: 'The --targetdevhubusername flag is deprecated and will be removed in v57 or later.',
};

public async run(): Promise<UserDisplayResult> {
this.ux.warn('The --targetdevhubusername flag is deprecated and will be removed in v57 or later.');
this.logger = await Logger.child(this.constructor.name);
if (sfdc.matchesAccessToken(this.flags.targetusername as string)) {
throw new SfError(messages.getMessage('accessTokenError'), 'accessTokenErrorError', [
Expand Down
1 change: 1 addition & 0 deletions src/commands/force/user/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class UserListCommand extends SfdxCommand {
private conn: Connection;

public async run(): Promise<AuthList[]> {
this.ux.warn('The --targetdevhubusername flag is deprecated and will be removed in v57 or later.');
this.conn = this.org.getConnection();
// parallelize 2 org queries and 2 fs operations
const [userInfos, profileInfos, userAuthData, aliases] = await Promise.all([
Expand Down
1 change: 1 addition & 0 deletions src/commands/force/user/password/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class UserPasswordGenerateCommand extends SfdxCommand {
private passwordData: PasswordData[] = [];

public async run(): Promise<PasswordData[] | PasswordData> {
this.ux.warn('The --targetdevhubusername flag is deprecated and will be removed in v57 or later.');
this.usernames = (this.flags.onbehalfof as string[]) ?? [this.org.getUsername()];

const passwordCondition: PasswordConditions = {
Expand Down