File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,9 @@ If you have found an issue with the documentation or would like to contribute pl
1313## License
1414
1515Coilpack is open-sourced software licensed under the MIT license.
16+
17+ ## Helpful Links
18+
19+ - [ ExpressionEngine] ( https://expressionengine.com/ )
20+ - [ ExpressionEngine Github] ( https://github.com/expressionengine/expressionengine )
21+ - [ ExpressionEngine Slack] ( https://expressionengine.com/blog/join-us-in-slack )
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ public function handle(): int
5555
5656 $ this ->updateRoutesFile ();
5757
58+ $ this ->askForStar ();
59+
5860 return self ::SUCCESS ;
5961 }
6062
@@ -242,4 +244,31 @@ public function installRelease($release)
242244 }
243245 }
244246 }
247+
248+ protected function askForStar ()
249+ {
250+ $ url = 'https://github.com/expressionengine/coilpack ' ;
251+ $ question = "We're thrilled that you have chosen to use Coilpack! \n Would you like to tell others by starring our repo? (y/n) " ;
252+ $ response = strtolower ($ this ->ask ($ question , 'n ' ));
253+
254+ // If we don't get a "y" or "yes" we're done
255+ if (! in_array ($ response , ['y ' , 'yes ' ])) {
256+ return ;
257+ }
258+
259+ // Choose the proper command to open the url based on the current operating system
260+ $ openUrlCommands = [
261+ 'Darwin ' => 'open ' ,
262+ 'Linux ' => 'xdg-open ' ,
263+ 'Windows ' => 'start ' ,
264+ ];
265+
266+ $ command = array_key_exists (PHP_OS_FAMILY , $ openUrlCommands ) ? $ openUrlCommands [PHP_OS_FAMILY ] : null ;
267+
268+ if (! $ command ) {
269+ $ this ->info ("Oops, this is embarrassing. \n We can't open the url on your operating system but you can still star the repo: $ url " );
270+ }
271+
272+ exec ("$ command $ url " );
273+ }
245274}
You can’t perform that action at this time.
0 commit comments