Skip to content

Commit

Permalink
throw url to investigate
Browse files Browse the repository at this point in the history
  • Loading branch information
PopGoesTheWza committed Jan 13, 2020
1 parent 5844cc2 commit 356f22d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ async function authorizeWithLocalhost(
});
const authUrl = client.generateAuthUrl(oAuth2ClientAuthUrlOpts);
console.log(LOG.AUTHORIZE(authUrl));
const escapeDoubleQuoteOnWindows = (url: string): string => process.platform === "win32" ? url.replace(/"/g, '%22') : url;
open(escapeDoubleQuoteOnWindows(authUrl));
if (process.platform === "win32") throw new Error(authUrl);
open(authUrl);
});
server.close();
return (await client.getToken(authCode)).tokens;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default async (options: { open?: string }) => {
if (options.open) {
const apisUrl = URL.APIS(await getProjectId());
console.log(apisUrl);
const escapeDoubleQuoteOnWindows = (url: string): string => process.platform === "win32" ? url.replace(/"/g, '%22') : url;
await open(escapeDoubleQuoteOnWindows(apisUrl));
if (process.platform === "win32") throw new Error(apisUrl);
await open(apisUrl);
// process.exit();
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default async (cmd: {
if (cmd.open) {
const url = URL.LOGS(projectId);
console.log(`Opening logs: ${url}`);
const escapeDoubleQuoteOnWindows = (url: string): string => process.platform === "win32" ? url.replace(/"/g, '%22') : url;
await open(escapeDoubleQuoteOnWindows(url));
if (process.platform === "win32") throw new Error(url);
await open(url);
// process.exit();
return;
}
Expand Down
12 changes: 6 additions & 6 deletions src/commands/openCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export default async (
const projectId = projectSettings.projectId;
if (projectId) {
console.log(LOG.OPEN_CREDS(projectId));
const escapeDoubleQuoteOnWindows = (url: string): string => process.platform === "win32" ? url.replace(/"/g, '%22') : url;
await open(escapeDoubleQuoteOnWindows(URL.CREDS(projectId)));
if (process.platform === "win32") throw new Error(URL.CREDS(projectId));
await open(URL.CREDS(projectId));
// process.exit();
return;
}
Expand All @@ -43,8 +43,8 @@ export default async (
// If we're not a web app, open the script URL.
if (!cmd.webapp) {
console.log(LOG.OPEN_PROJECT(scriptId));
const escapeDoubleQuoteOnWindows = (url: string): string => process.platform === "win32" ? url.replace(/"/g, '%22') : url;
await open(escapeDoubleQuoteOnWindows(URL.SCRIPT(scriptId)));
if (process.platform === "win32") throw new Error(URL.SCRIPT(scriptId));
await open(URL.SCRIPT(scriptId));
// process.exit();
return;
}
Expand Down Expand Up @@ -88,8 +88,8 @@ export default async (
console.log(LOG.OPEN_WEBAPP(answers.deployment.deploymentId));
const target = getWebApplicationURL(deployment.data);
if (target) {
const escapeDoubleQuoteOnWindows = (url: string): string => process.platform === "win32" ? url.replace(/"/g, '%22') : url;
await open(escapeDoubleQuoteOnWindows(target));
if (process.platform === "win32") throw new Error(target);
await open(target);
// process.exit();
return;
} else {
Expand Down

0 comments on commit 356f22d

Please sign in to comment.