File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env php
2+ <?php
3+
4+ /**
5+ * Zero-to-Prod Factory Documentation Publisher
6+ *
7+ * Publishes the README.md file to the user's documentation directory.
8+ */
9+
10+ require getcwd ().'/vendor/autoload.php ' ;
11+
12+ use Zerotoprod \PackageHelper \PackageHelper ;
13+
14+ $ target_path = getcwd ().'/docs/zero-to-prod/package-helper/ ' ;
15+ if (isset ($ argv [1 ])) {
16+ $ target_path = rtrim ($ argv [1 ], '/ ' ).'/ ' ;
17+ }
18+
19+ $ source_file = __DIR__ .'/../README.md ' ;
20+
21+ if (!file_exists ($ source_file )) {
22+ fwrite (STDERR , "Error: Not found $ source_file \n" );
23+ exit (1 );
24+ }
25+
26+ try {
27+ PackageHelper::copy ($ source_file , $ target_path );
28+ exit (0 );
29+ } catch (RuntimeException $ e ) {
30+ fwrite (STDERR , "Error: " .$ e ->getMessage ()."\n" );
31+ exit (1 );
32+ }
33+
You can’t perform that action at this time.
0 commit comments