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

Add message with personal access key URL to prompt #465

Merged
merged 2 commits into from
Apr 6, 2021
Merged
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
7 changes: 5 additions & 2 deletions packages/cli/lib/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
DEFAULT_OAUTH_SCOPES,
} = require('@hubspot/cli-lib/lib/constants');
const { getHubSpotWebsiteOrigin } = require('@hubspot/cli-lib/lib/urls');
const { logger } = require('@hubspot/cli-lib/logger');
const { API_KEY_REGEX, STRING_WITH_NO_SPACES_REGEX } = require('./regex');

const promptUser = async promptConfig => {
Expand All @@ -19,7 +20,9 @@ const promptUser = async promptConfig => {
const personalAccessKeyPrompt = async ({ env } = {}) => {
await promptUser([PERSONAL_ACCESS_KEY_BROWSER_OPEN_PREP]);
const websiteOrigin = getHubSpotWebsiteOrigin(env);
open(`${websiteOrigin}/l/personal-access-key`, { url: true });
const url = `${websiteOrigin}/l/personal-access-key`;
open(url, { url: true });
logger.log(`Opening ${url} in your web browser`);
const { personalAccessKey } = await promptUser(PERSONAL_ACCESS_KEY);

return {
Expand Down Expand Up @@ -99,7 +102,7 @@ const ACCOUNT_API_KEY = {
const PERSONAL_ACCESS_KEY_BROWSER_OPEN_PREP = {
name: 'personalAcessKeyBrowserOpenPrep',
message:
"When you're ready, we'll open a secure page in your default browser where you can view and copy your personal access key, which you'll need to complete the next step.\n<Press enter when you are ready to continue>",
"When you're ready, we'll open a secure page in your default browser where you can view and copy your personal access key, which you'll need to complete the next step.\n<Press enter to open the page and generate your personal access key>",
};

const PERSONAL_ACCESS_KEY = {
Expand Down