Skip to content

Commit 0cf2882

Browse files
committed
refactor: Removing --open option
1 parent 57984ba commit 0cf2882

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

templates/cli/base/requests/api.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
if (parseOutput) {
2020
{%~ if methodHaveConsolePreview(method.name,service.name) %}
2121
if(console) {
22-
showConsoleLink('{{service.name}}', '{{ method.name }}',open
22+
showConsoleLink('{{service.name}}', '{{ method.name }}'
2323
{%- for parameter in method.parameters.path -%}{%- set param = (parameter.name | caseCamel | escapeKeyword) -%}{%- if param ends with 'Id' -%}, {{ param }} {%- endif -%}{%- endfor -%}
2424
);
2525
} else {

templates/cli/lib/commands/command.js.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({
7070
{%- if 'multipart/form-data' in method.consumes -%},onProgress = () => {}{%- endif -%}
7171

7272
{%- if method.type == 'location' -%}, destination{%- endif -%}
73-
{% if methodHaveConsolePreview(method.name,service.name) %}, console, open{%- endif -%}
73+
{% if methodHaveConsolePreview(method.name,service.name) %}, console{%- endif -%}
7474
}) => {
7575
{%~ endblock %}
7676
let client = !sdk ? await {% if service.name == "projects" %}sdkForConsole(){% else %}sdkForProject(){% endif %} :
@@ -97,7 +97,6 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({
9797
{% endif %}
9898
{% if methodHaveConsolePreview(method.name,service.name) %}
9999
.option(`--console`, `Get the resource console url`)
100-
.option(`--open`, `Use with '--console' to open the using default browser`)
101100
{% endif %}
102101
{% endautoescape %}
103102
.action(actionRunner({{ service.name | caseLower }}{{ method.name | caseUcfirst }}))

templates/cli/lib/utils.js.twig

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const checkDeployConditions = (localConfig) => {
2424
}
2525
}
2626

27-
function showConsoleLink(serviceName, action, open, ...ids) {
27+
function showConsoleLink(serviceName, action, ...ids) {
2828
const projectId = localConfig.getProject().projectId;
2929

3030
const url = new URL(globalConfig.getEndpoint().replace('/v1', '/console'));
@@ -64,17 +64,6 @@ function showConsoleLink(serviceName, action, open, ...ids) {
6464

6565

6666
success(url);
67-
68-
if (open) {
69-
const start = (process.platform == 'darwin' ? 'open' : process.platform == 'win32' ? 'start' : 'xdg-open');
70-
71-
cp.exec(`${start} ${url}`, (err, stdout, stderr) => {
72-
if (err !== null) {
73-
console.log('\n');
74-
error('Opening in default browser. ' + err)
75-
}
76-
});
77-
}
7867
}
7968

8069
function getAccountPath(action) {

0 commit comments

Comments
 (0)