2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 08:16:28 +00:00

Get-app from port specific ssh git server (#1299)

* Get-app from port specific ssh git server

Current bench package fails to get an app from a private git server with a specific ssh port other than the normal 22.

* test: Added tests for ssh ports

Co-authored-by: Aradhya Tripathi <67282231+Aradhya-Tripathi@users.noreply.github.com>
Co-authored-by: Aradhya <aradhyatripathi51@gmail.com>
This commit is contained in:
Kelvin zawala 2022-05-03 13:52:10 +02:00 committed by GitHub
parent 31d9de4dec
commit 7b8f16bcb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -116,7 +116,7 @@ class AppMeta:
name = url if url else self.name
if name.startswith("git@") or name.startswith("ssh://"):
self.use_ssh = True
_first_part, _second_part = name.split(":")
_first_part, _second_part = self.name.rsplit(":", 1)
self.remote_server = _first_part.split("@")[-1]
self.org, _repo = _second_part.rsplit("/", 1)
else:

View File

@ -73,3 +73,7 @@ class TestUtils(unittest.TestCase):
self.assertEqual("11.0", fake_bench.apps.states["frappe"]["version"])
shutil.rmtree(bench_dir)
def test_ssh_ports(self):
app = App("git@github.com:22:frappe/frappe")
self.assertEqual((app.use_ssh, app.org, app.repo), (True, "frappe", "frappe"))