From 135eef57e371311c8eae5070935358e58d2d37ef Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 25 Sep 2023 15:11:33 +0800 Subject: [PATCH] fix(sftp): bug --- package-lock.json | 2 +- packages/sftp/lib/sftp/read-config.mjs | 4 +++- packages/sftp/package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 34350fa..86b644c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6484,7 +6484,7 @@ }, "packages/sftp": { "name": "@bring-it/sftp", - "version": "0.1.3", + "version": "0.1.4", "license": "MIT", "dependencies": { "yargs": "^17.7.2" diff --git a/packages/sftp/lib/sftp/read-config.mjs b/packages/sftp/lib/sftp/read-config.mjs index 8e62352..4f4ba4e 100644 --- a/packages/sftp/lib/sftp/read-config.mjs +++ b/packages/sftp/lib/sftp/read-config.mjs @@ -89,7 +89,9 @@ export function checkServer(server) { port = 22, path = '/mnt', } = pickBy( - URL.canParse(`sftp://${server}`) ? parseURI(server) : readConfig(server), + /\S+@\S+/.test(server) && URL.canParse(`sftp://${server}`) + ? parseURI(server) + : readConfig(server), ); if (!user) { diff --git a/packages/sftp/package.json b/packages/sftp/package.json index af7cac8..90fadca 100644 --- a/packages/sftp/package.json +++ b/packages/sftp/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/sftp", - "version": "0.1.3", + "version": "0.1.4", "description": "SFTP deployment tool for frontend", "license": "MIT", "author": {