@@ -38,21 +38,19 @@ protected function doInstall(PackageInterface $package, string $path, string $ur
38
38
// Ensure we are allowed to use this URL by config
39
39
$ this ->config ->prohibitUrlByConfig ($ url , $ this ->io );
40
40
41
- $ url = ProcessExecutor::escape ($ url );
42
- $ ref = ProcessExecutor::escape ($ package ->getSourceReference ());
43
41
$ repoFile = $ path . '.fossil ' ;
44
42
$ this ->io ->writeError ("Cloning " .$ package ->getSourceReference ());
45
- $ command = sprintf ( 'fossil clone -- %s %s ' , $ url , ProcessExecutor:: escape ( $ repoFile)) ;
43
+ $ command = [ 'fossil ' , ' clone ' , ' -- ' , $ url , $ repoFile] ;
46
44
if (0 !== $ this ->process ->execute ($ command , $ ignoredOutput )) {
47
- throw new \RuntimeException ('Failed to execute ' . $ command . "\n\n" . $ this ->process ->getErrorOutput ());
45
+ throw new \RuntimeException ('Failed to execute ' . implode ( ' ' , $ command) . "\n\n" . $ this ->process ->getErrorOutput ());
48
46
}
49
- $ command = sprintf ( 'fossil open --nested -- %s ' , ProcessExecutor:: escape ( $ repoFile)) ;
47
+ $ command = [ 'fossil ' , ' open ' , ' --nested ' , ' -- ' , $ repoFile] ;
50
48
if (0 !== $ this ->process ->execute ($ command , $ ignoredOutput , realpath ($ path ))) {
51
- throw new \RuntimeException ('Failed to execute ' . $ command . "\n\n" . $ this ->process ->getErrorOutput ());
49
+ throw new \RuntimeException ('Failed to execute ' . implode ( ' ' , $ command) . "\n\n" . $ this ->process ->getErrorOutput ());
52
50
}
53
- $ command = sprintf ( 'fossil update -- %s ' , $ ref ) ;
51
+ $ command = [ 'fossil ' , ' update ' , ' -- ' , $ package -> getSourceReference ()] ;
54
52
if (0 !== $ this ->process ->execute ($ command , $ ignoredOutput , realpath ($ path ))) {
55
- throw new \RuntimeException ('Failed to execute ' . $ command . "\n\n" . $ this ->process ->getErrorOutput ());
53
+ throw new \RuntimeException ('Failed to execute ' . implode ( ' ' , $ command) . "\n\n" . $ this ->process ->getErrorOutput ());
56
54
}
57
55
58
56
return \React \Promise \resolve (null );
@@ -66,16 +64,18 @@ protected function doUpdate(PackageInterface $initial, PackageInterface $target,
66
64
// Ensure we are allowed to use this URL by config
67
65
$ this ->config ->prohibitUrlByConfig ($ url , $ this ->io );
68
66
69
- $ ref = ProcessExecutor::escape ($ target ->getSourceReference ());
70
67
$ this ->io ->writeError (" Updating to " .$ target ->getSourceReference ());
71
68
72
69
if (!$ this ->hasMetadataRepository ($ path )) {
73
70
throw new \RuntimeException ('The .fslckout file is missing from ' .$ path .', see https://getcomposer.org/commit-deps for more information ' );
74
71
}
75
72
76
- $ command = sprintf ('fossil pull && fossil up %s ' , $ ref );
77
- if (0 !== $ this ->process ->execute ($ command , $ ignoredOutput , realpath ($ path ))) {
78
- throw new \RuntimeException ('Failed to execute ' . $ command . "\n\n" . $ this ->process ->getErrorOutput ());
73
+ if (0 !== $ this ->process ->execute (['fossil ' , 'pull ' ], $ ignoredOutput , realpath ($ path ))) {
74
+ throw new \RuntimeException ("Failed to execute fossil pull \n\n" . $ this ->process ->getErrorOutput ());
75
+ }
76
+
77
+ if (0 !== $ this ->process ->execute (['fossil ' , 'up ' , $ target ->getSourceReference ()], $ ignoredOutput , realpath ($ path ))) {
78
+ throw new \RuntimeException ("Failed to execute fossil up \n\n" . $ this ->process ->getErrorOutput ());
79
79
}
80
80
81
81
return \React \Promise \resolve (null );
@@ -90,7 +90,7 @@ public function getLocalChanges(PackageInterface $package, string $path): ?strin
90
90
return null ;
91
91
}
92
92
93
- $ this ->process ->execute ('fossil changes ' , $ output , realpath ($ path ));
93
+ $ this ->process ->execute ([ 'fossil ' , ' changes '] , $ output , realpath ($ path ));
94
94
95
95
$ output = trim ($ output );
96
96
@@ -102,10 +102,10 @@ public function getLocalChanges(PackageInterface $package, string $path): ?strin
102
102
*/
103
103
protected function getCommitLogs (string $ fromReference , string $ toReference , string $ path ): string
104
104
{
105
- $ command = sprintf ( 'fossil timeline -t ci -W 0 -n 0 before %s ' , ProcessExecutor:: escape ( $ toReference)) ;
105
+ $ command = [ 'fossil ' , ' timeline ' , ' -t ' , ' ci ' , ' -W ' , ' 0 ' , ' -n ' , ' 0 ' , ' before ' , $ toReference] ;
106
106
107
107
if (0 !== $ this ->process ->execute ($ command , $ output , realpath ($ path ))) {
108
- throw new \RuntimeException ('Failed to execute ' . $ command . "\n\n" . $ this ->process ->getErrorOutput ());
108
+ throw new \RuntimeException ('Failed to execute ' . implode ( ' ' , $ command) . "\n\n" . $ this ->process ->getErrorOutput ());
109
109
}
110
110
111
111
$ log = '' ;
0 commit comments