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:
parent
31d9de4dec
commit
7b8f16bcb4
@ -116,7 +116,7 @@ class AppMeta:
|
|||||||
name = url if url else self.name
|
name = url if url else self.name
|
||||||
if name.startswith("git@") or name.startswith("ssh://"):
|
if name.startswith("git@") or name.startswith("ssh://"):
|
||||||
self.use_ssh = True
|
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.remote_server = _first_part.split("@")[-1]
|
||||||
self.org, _repo = _second_part.rsplit("/", 1)
|
self.org, _repo = _second_part.rsplit("/", 1)
|
||||||
else:
|
else:
|
||||||
|
@ -73,3 +73,7 @@ class TestUtils(unittest.TestCase):
|
|||||||
self.assertEqual("11.0", fake_bench.apps.states["frappe"]["version"])
|
self.assertEqual("11.0", fake_bench.apps.states["frappe"]["version"])
|
||||||
|
|
||||||
shutil.rmtree(bench_dir)
|
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"))
|
Loading…
Reference in New Issue
Block a user