@@ -72,33 +72,29 @@ public function printInfo(): void {
72
72
}
73
73
74
74
protected function prepareLocalRepo (): void {
75
- $ root = $ this ->fileFindDir ('composer.json ' );
75
+ $ root = $ this ->fileFindDir ('composer.json ' , realpath ( dirname ( __FILE__ ). ' /../.. ' ) );
76
76
77
77
$ this ->fs ->copy ($ root . '/composer.json ' , $ this ->repo . '/composer.json ' );
78
- $ this ->fs ->mirror ($ root . '/scripts ' , $ this ->repo . '/scripts ' );
79
- $ this ->fs ->mirror ($ root . '/.circleci ' , $ this ->repo . '/.circleci ' );
80
- $ this ->fs ->copy ($ root . '/myfile1.txt ' , $ this ->repo . '/myfile1.txt ' );
81
-
82
- // Add the local repository to the composer.json file.
83
- $ composerjson = file_get_contents ($ this ->repo . '/composer.json ' );
84
- if ($ composerjson === FALSE ) {
85
- throw new \Exception ('Failed to read the local composer.json file. ' );
86
- }
87
-
88
- /** @var array $dst_json */
89
- $ dst_json = json_decode ($ composerjson , TRUE );
90
- if (!$ dst_json ) {
91
- throw new \Exception ('Failed to decode the local composer.json file. ' );
92
- }
93
-
94
- $ dst_json ['repositories ' ][] = [
95
- 'type ' => 'path ' ,
96
- 'url ' => $ this ->repo ,
97
- 'options ' => [
98
- 'symlink ' => FALSE ,
99
- ],
100
- ];
101
- file_put_contents ($ this ->repo . '/composer.json ' , json_encode ($ dst_json , JSON_PRETTY_PRINT ));
78
+ $ this ->fs ->copy ($ root . '/.scaffold/Customizer.php ' , $ this ->repo . '/.scaffold/Customizer.php ' );
79
+ // $this->fs->mirror($root . '/.scaffold', $this->repo . '/.scaffold');
80
+ // $this->fs->mirror($root . '/scripts', $this->repo . '/scripts');
81
+ // $this->fs->mirror($root . '/.circleci', $this->repo . '/.circleci');
82
+ // $this->fs->copy($root . '/myfile1.txt', $this->repo . '/myfile1.txt');
83
+
84
+ // // Add the local repository to the composer.json file.
85
+ // $composerjson = file_get_contents($this->repo . '/composer.json');
86
+ // if ($composerjson === FALSE) {
87
+ // throw new \Exception('Failed to read the local composer.json file.');
88
+ // }
89
+ //
90
+ // /** @var array $dst_json */
91
+ // $dst_json = json_decode($composerjson, TRUE);
92
+ // if (!$dst_json) {
93
+ // throw new \Exception('Failed to decode the local composer.json file.');
94
+ // }
95
+ //
96
+ //
97
+ // file_put_contents($this->repo . '/composer.json', json_encode($dst_json, JSON_PRETTY_PRINT));
102
98
}
103
99
104
100
}
0 commit comments