From 39fb36abb0dad2d78c3e5ee9c3dedba98c428605 Mon Sep 17 00:00:00 2001 From: S M Mahmudul Hasan Date: Thu, 1 Aug 2024 13:12:13 +0600 Subject: [PATCH 1/2] added missing token in vercel domain add --- src/utils/VercelManager.js | 4 +++- tests/utils/VercelManager.test.js | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/utils/VercelManager.js b/src/utils/VercelManager.js index 2ae5652..ba6f5a8 100644 --- a/src/utils/VercelManager.js +++ b/src/utils/VercelManager.js @@ -139,7 +139,9 @@ class VercelManager { addDomain(domain) { console.log(`\nAdding domain ${domain}...`); try { - execSync(`vercel domains add ${domain}`); + execSync( + `vercel domains add ${domain} --token ${this.vercelToken}` + ); } catch (error) { if (error.message.includes("have access")) { console.log( diff --git a/tests/utils/VercelManager.test.js b/tests/utils/VercelManager.test.js index 895eb71..86becac 100644 --- a/tests/utils/VercelManager.test.js +++ b/tests/utils/VercelManager.test.js @@ -207,7 +207,9 @@ describe("VercelManager", () => { execSync.mockReturnValue(undefined); vercelManager.addDomain("example.com"); - expect(execSync).toHaveBeenCalledWith("vercel domains add example.com"); + expect(execSync).toHaveBeenCalledWith( + "vercel domains add example.com --token mock_token" + ); }); it("should log a message for a false positive warning regarding domain addition", () => { @@ -217,7 +219,9 @@ describe("VercelManager", () => { vercelManager.addDomain("example.com"); - expect(execSync).toHaveBeenCalledWith("vercel domains add example.com"); + expect(execSync).toHaveBeenCalledWith( + "vercel domains add example.com --token mock_token" + ); expect(console.log).toHaveBeenCalledWith( "\nAbove error regarding domain is a false positive warning from vercel! Please verify domain addition in your vercel project settings." ); @@ -230,7 +234,9 @@ describe("VercelManager", () => { vercelManager.addDomain("example.com"); - expect(execSync).toHaveBeenCalledWith("vercel domains add example.com"); + expect(execSync).toHaveBeenCalledWith( + "vercel domains add example.com --token mock_token" + ); expect(console.error).toHaveBeenCalledWith( "Failed to add domain example.com:", "Some other error" From d1bec0786ef45ca3ab51cd96a34f4e44c23555f6 Mon Sep 17 00:00:00 2001 From: S M Mahmudul Hasan Date: Thu, 1 Aug 2024 13:12:53 +0600 Subject: [PATCH 2/2] update syntax in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96cba7b..9b26f07 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ verceler -vt -gt [options] ### Example ```sh -verceler --vt your_vercel_token --gt your_github_token --create-github-workflow --load-env preview,development,production --domain yourdomain.com +verceler -vt your_vercel_token -gt your_github_token --create-github-workflow --load-env preview,development,production --domain yourdomain.com ``` This command will: