@@ -16,12 +16,7 @@ REM Add Windows\system32 to start of path to find the right "timeout" command
16
16
REM Cygwin can end up with 'unix like' timeout in path instead otherwise
17
17
PATH C:\Windows\System32;%PATH%
18
18
19
- REM Fetch the external Docker Unison port number
20
- FOR /f " delims=" %%A IN ('docker-compose port web 5000') DO SET " CMD_OUTPUT = %%A "
21
- FOR /f " tokens=1,* delims=:" %%A IN (" %CMD_OUTPUT% " ) DO SET " UNISON_PORT = %%B "
22
-
23
19
@ SET LOCAL_ROOT = ./shared/www
24
- @ SET REMOTE_ROOT = socket://localhost:%UNISON_PORT% //var/www
25
20
26
21
@ SET IGNORE =
27
22
@@ -34,8 +29,6 @@ REM Magento files not worth pulling locally.
34
29
@ SET IGNORE = %IGNORE% -ignore " Path magento2/var/tmp"
35
30
@ SET IGNORE = %IGNORE% -ignore " Path magento2/var/.setup_cronjob_status"
36
31
@ SET IGNORE = %IGNORE% -ignore " Path magento2/var/.update_cronjob_status"
37
- @ SET IGNORE = %IGNORE% -ignore " Path magento2/pub/media"
38
- @ SET IGNORE = %IGNORE% -ignore " Path magento2/pub/static"
39
32
40
33
REM Other files not worth pushing to the container.
41
34
@ SET IGNORE = %IGNORE% -ignore " Path magento2/.git"
@@ -46,6 +39,11 @@ REM Other files not worth pushing to the container.
46
39
@ SET IGNORE = %IGNORE% -ignore " Name {.*.swp}"
47
40
@ SET IGNORE = %IGNORE% -ignore " Name {.unison.*}"
48
41
42
+ REM Fetch the external Docker Unison port number
43
+ FOR /f " delims=" %%A IN ('docker-compose port web 5000') DO SET " CMD_OUTPUT = %%A "
44
+ FOR /f " tokens=1,* delims=:" %%A IN (" %CMD_OUTPUT% " ) DO SET " UNISON_PORT = %%B "
45
+ @ SET REMOTE_ROOT = socket://localhost:%UNISON_PORT% //var/www
46
+
49
47
@ set UNISONARGS = %LOCAL_ROOT% %REMOTE_ROOT% -prefer %LOCAL_ROOT% -preferpartial " Path var -> %REMOTE_ROOT% " -auto -batch %IGNORE%
50
48
51
49
IF NOT EXIST %LOCAL_ROOT% /magento2/vendor (
@@ -57,6 +55,14 @@ REM **** Entering file watch mode ****
57
55
:loop_sync
58
56
.\unison %UNISONARGS% -repeat watch
59
57
TIMEOUT 5
58
+
59
+ REM Re-fetch the external Docker Unison port number in case it changed.
60
+ FOR /f " delims=" %%A IN ('docker-compose port web 5000') DO SET " CMD_OUTPUT = %%A "
61
+ FOR /f " tokens=1,* delims=:" %%A IN (" %CMD_OUTPUT% " ) DO SET " UNISON_PORT = %%B "
62
+ @ SET REMOTE_ROOT = socket://localhost:%UNISON_PORT% //var/www
63
+
64
+ @ set UNISONARGS = %LOCAL_ROOT% %REMOTE_ROOT% -prefer %LOCAL_ROOT% -preferpartial " Path var -> %REMOTE_ROOT% " -auto -batch %IGNORE%
65
+
60
66
@ GOTO loop_sync
61
67
62
68
:exit
0 commit comments