@@ -128,7 +128,12 @@ protected function getBltPackage($operation) {
128
128
*/
129
129
protected function executeBltUpdate ($ version ) {
130
130
$ options = $ this ->getOptions ();
131
- if ($ options ['blt ' ]['update ' ]) {
131
+
132
+ if ($ this ->isInitialInstall ()) {
133
+ $ this ->io ->write ('<info>Creating BLT templated files...</info> ' );
134
+ $ success = $ this ->executeCommand ('blt create-project ' , [], TRUE );
135
+ }
136
+ elseif ($ options ['blt ' ]['update ' ]) {
132
137
$ this ->io ->write ('<info>Updating BLT templated files...</info> ' );
133
138
134
139
// Rsyncs, updates composer.json, project.yml, executes scripted updates for version delta.
@@ -148,6 +153,27 @@ protected function executeBltUpdate($version) {
148
153
}
149
154
}
150
155
156
+ /**
157
+ * Determine if BLT is being installed for the first time on this project.
158
+ *
159
+ * This would execute in the context of `composer create-project`.
160
+ *
161
+ * @return bool
162
+ * TRUE if this is the initial install of BLT.
163
+ */
164
+ protected function isInitialInstall () {
165
+ if (!file_exists ($ this ->getRepoRoot () . '/blt/project.yml ' )
166
+ && !file_exists ($ this ->getRepoRoot () . '/blt/.schema-version ' )
167
+ && file_exists ($ this ->getRepoRoot () . '/.travis.yml ' )
168
+ && file_exists ($ this ->getRepoRoot () . '/LICENSE.txt ' )
169
+ && file_exists ($ this ->getRepoRoot () . '/README.md ' )
170
+ ) {
171
+ return TRUE ;
172
+ }
173
+
174
+ return FALSE ;
175
+ }
176
+
151
177
/**
152
178
* Returns the repo root's filepath, assumed to be one dir above vendor dir.
153
179
*
0 commit comments