Skip to content

Commit cc993c8

Browse files
committed
Update to auto-documenting procedure
1 parent efaf27c commit cc993c8

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/Docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: composer update
2323

2424
- name: Generate Documentation
25-
run: php ./makeDocs.php
25+
run: php ./makeDocs.php --push
2626

2727
- name: Commit & Push to Wiki
2828
run: |

docs

Submodule docs updated from 87b84ac to 77a40a7

makeDocs.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,21 @@
3030
include "vendor/skayo/phpdoc-md/bin/phpdocmd";
3131
echo " Complete.\n";
3232

33-
//
34-
//echo "Committing and pushing to Repository...";
35-
//echo exec("cd " . __DIR__ . "/docs && git add *.md && git commit -m \"Auto-Updated Documentation\" && git push");
36-
//echo " Complete.\n";
33+
// if git diff has no results, exit.
34+
$diff = trim(exec("cd " . __DIR__ . "/docs && git diff --stat"));
35+
if ($diff === "") {
36+
echo "No changes detected in documentation. Exiting.\n";
37+
exit(0);
38+
}
39+
40+
41+
echo "Committing and pushing to Repository...";
42+
echo exec("cd " . __DIR__ . "/docs && git add *.md && git commit -m \"Auto-Updated Documentation\"");
43+
echo " Complete.\n";
44+
45+
// if --push is set, push the changes.
46+
if (in_array("--push", $argv)) {
47+
echo "Pushing to remote repository...";
48+
echo exec("cd " . __DIR__ . "/docs && git push");
49+
echo " Complete.\n";
50+
}

0 commit comments

Comments
 (0)