File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ public function runDockerComposeCommand(string $command): bool
108108 public function resetFilesOwner (): bool
109109 {
110110 return $ this ->runDockerComposeCommand (
111- 'run build bash -c "chown -R $(id -u):$(id -g) . /composer/cache" '
112- );
111+ 'run --user root build bash -c "uid=$(stat -c %u . 2>/dev/null || stat -f %u .); gid=$(stat -c %g . 2>/dev/null || stat -f %g .); chown -R $uid:$gid . /composer/cache" '
112+ );
113113 }
114114
115115 /**
Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ public function destination(string $destination): self
8080 public function getCommand (): string
8181 {
8282 return sprintf (
83- 'docker cp "$(docker-compose ps -q %s)":%s %s ' ,
83+ '(docker-compose cp %s:%s %s) || (docker cp $(docker-compose ps -q %s):%s %s) ' ,
84+ $ this ->container ,
85+ $ this ->source ,
86+ $ this ->destination ,
8487 $ this ->container ,
8588 $ this ->source ,
8689 $ this ->destination
@@ -108,4 +111,4 @@ public function run(): Result
108111
109112 return $ this ->executeCommand ($ this ->getCommand ());
110113 }
111- }
114+ }
Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ public function destination(string $destination): self
8080 public function getCommand (): string
8181 {
8282 return sprintf (
83- 'docker cp "$(docker-compose ps -q %s)":%s %s ' ,
83+ '(docker-compose cp %s:%s %s) || (docker cp $(docker-compose ps -q %s):%s %s) ' ,
84+ $ this ->source ,
85+ $ this ->container ,
86+ $ this ->destination ,
8487 $ this ->source ,
8588 $ this ->container ,
8689 $ this ->destination
@@ -102,4 +105,4 @@ public function run(): Result
102105
103106 return $ this ->executeCommand ($ this ->getCommand ());
104107 }
105- }
108+ }
You can’t perform that action at this time.
0 commit comments