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

WARN! --confirm is deprecated, please use --yes instead #60

Open
simonw opened this issue Aug 20, 2022 · 4 comments
Open

WARN! --confirm is deprecated, please use --yes instead #60

simonw opened this issue Aug 20, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@simonw
Copy link
Owner

simonw commented Aug 20, 2022

Spotted this in the output here: https://github.com/simonw/scotrail-datasette/runs/7934863951?check_suite_focus=true

@simonw simonw added the bug Something isn't working label Aug 20, 2022
@simonw
Copy link
Owner Author

simonw commented Aug 20, 2022

Relevant code:

@simonw
Copy link
Owner Author

simonw commented Aug 21, 2022

Tested my fix for this locally and got:

Vercel CLI 27.2.0
Error! unknown or unexpected option: --yes
Error: Command '['vercel', '--yes', '--prod', '--env',

This is a bit tricky: I don't want to break this plugin for people who have an older version of Vercel installed, but I'd like people with the newer version not to get that warning.

@simonw
Copy link
Owner Author

simonw commented Aug 21, 2022

This change is from https://github.com/vercel/vercel/releases/tag/vercel%4027.4.0

So I could run vercel --version and check if it's equal to or higher than 27.4.0.

@simonw
Copy link
Owner Author

simonw commented Aug 21, 2022

Here's my prototype fix so far:

diff --git a/datasette_publish_vercel/__init__.py b/datasette_publish_vercel/__init__.py
index 7aa18a1..ba19214 100644
--- a/datasette_publish_vercel/__init__.py
+++ b/datasette_publish_vercel/__init__.py
@@ -286,7 +286,7 @@ def _publish_vercel(
             click.echo("    vercel --prod".format(generate_dir), err=True)
         else:
             # Run the deploy with Vercel
-            cmd = ["vercel", "--confirm"]
+            cmd = ["vercel", "--yes"]
             if debug:
                 cmd.append("--debug")
             if not no_prod:
diff --git a/tests/test_publish_vercel.py b/tests/test_publish_vercel.py
index ff216a7..2eb51e2 100644
--- a/tests/test_publish_vercel.py
+++ b/tests/test_publish_vercel.py
@@ -70,7 +70,7 @@ def test_publish_vercel(mock_run, mock_which, alias):
                 mock.call(
                     [
                         "vercel",
-                        "--confirm",
+                        "--yes",
                         "--prod",
                         "--env",
                         "DATASETTE_SECRET=S",
@@ -108,7 +108,7 @@ def test_publish_vercel_public(mock_run, mock_which):
                 mock.call(
                     [
                         "vercel",
-                        "--confirm",
+                        "--yes",
                         "--prod",
                         "--public",
                         "--env",
@@ -150,7 +150,7 @@ def test_publish_vercel_token(mock_run, mock_which):
                 mock.call(
                     [
                         "vercel",
-                        "--confirm",
+                        "--yes",
                         "--prod",
                         "--token",
                         "xyz",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant