You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Once installed, you should be able to run `statamic {command name}` from within
25
25
When you install starter kits, the CLI might present you with a warning that the GitHub API limit is reached. [Generate a Personal acces token](https://github.com/settings/tokens/new) and paste it in your terminal with this command so Composer will save it for future use:
if (version_compare($currentVersion, $latestVersion, '<')) {
120
+
$this->shouldUpdateCliToVersion = $latestVersion;
121
+
}
122
+
123
+
return$this;
124
+
}
125
+
126
+
/**
127
+
* Notify user if a statamic/cli upgrade exists.
128
+
*
129
+
* @return $this
130
+
*/
131
+
protectedfunctionnotifyIfOldCliVersion()
132
+
{
133
+
if (! $this->shouldUpdateCliToVersion) {
134
+
return$this;
135
+
}
136
+
137
+
$this->output->write(PHP_EOL);
138
+
$this->output->write("<comment>This is an old version of the Statamic CLI Tool, please upgrade to {$this->shouldUpdateCliToVersion}!</comment>".PHP_EOL);
139
+
$this->output->write("<comment>If you have a global composer installation, you may upgrade by running the following command:</comment>".PHP_EOL);
140
+
$this->output->write("<comment>composer global update statamic/cli</comment>".PHP_EOL);
141
+
142
+
return$this;
143
+
}
144
+
91
145
/**
92
146
* Process arguments and options.
93
147
*
@@ -171,7 +225,7 @@ protected function showStatamicTitleArt()
171
225
}
172
226
173
227
/**
174
-
* Ask which starter repo to install.
228
+
* Ask which starter kit repo to install.
175
229
*
176
230
* @return $this
177
231
*/
@@ -211,6 +265,54 @@ protected function askForRepo()
211
265
return$this;
212
266
}
213
267
268
+
/**
269
+
* Detect starter kit repo vcs, using same precedence logic used in statamic/cms.
270
+
*
271
+
* @return $this
272
+
*/
273
+
protectedfunctiondetectRepoVcs()
274
+
{
275
+
if ($this->local) {
276
+
return$this;
277
+
}
278
+
279
+
$request = newClient(['http_errors' => false]);
280
+
281
+
if ($request->get("https://repo.packagist.org/p2/{$this->starterKit}.json")->getStatusCode() === 200) {
282
+
return$this;
283
+
}
284
+
285
+
if ($request->get("https://github.com/{$this->starterKit}")->getStatusCode() === 200) {
0 commit comments