File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,15 +54,16 @@ protected function mountSharedDirectories(SessionContext $context): void
5454 $ project_dir = $ context ->project_dir ;
5555
5656 $ this ->ssh ->run ("sudo mkdir -p {$ mount_point }" );
57- $ this ->ssh ->run ("sudo chown -R admin:admin {$ mount_point }" );
5857
5958 while (time () - $ start < $ mount_timeout ) {
6059 try {
61- $ result = $ this ->ssh ->run ("sudo mount -t virtiofs com.apple.virtio-fs.automount {$ mount_point } 2>&1; true " );
62- $ output = trim ($ result ->output ());
60+ if (! $ this ->isMounted ($ mount_point )) {
61+ $ result = $ this ->ssh ->run ("sudo mount -t virtiofs com.apple.virtio-fs.automount {$ mount_point } 2>&1; true " );
62+ $ output = trim ($ result ->output ());
6363
64- if ($ output && $ output !== $ last_error ) {
65- $ last_error = $ output ;
64+ if ($ output && $ output !== $ last_error ) {
65+ $ last_error = $ output ;
66+ }
6667 }
6768
6869 $ this ->ssh ->run ("mountpoint -q {$ mount_point }" );
@@ -100,6 +101,16 @@ protected function mountSharedDirectories(SessionContext $context): void
100101 );
101102 }
102103
104+ protected function isMounted (string $ path ): bool
105+ {
106+ try {
107+ $ this ->ssh ->run ("mountpoint -q {$ path }" );
108+ return true ;
109+ } catch (Throwable ) {
110+ return false ;
111+ }
112+ }
113+
103114 protected function waitForSsh (SessionContext $ context ): void
104115 {
105116 $ start = time ();
You can’t perform that action at this time.
0 commit comments