aboutsummaryrefslogtreecommitdiff
path: root/metranslator/api.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-04 15:42:09 +0100
committerMinteck <contact@minteck.org>2021-12-04 15:42:09 +0100
commitefadd6eda15122944d95e1b3f01c3f4c35d1f40a (patch)
tree7adce217645cdd220118c58cebc3dc129922edb2 /metranslator/api.php
parent79d295f26659dd3b6aea93bb64803bf0778a8f84 (diff)
downloadmain-efadd6eda15122944d95e1b3f01c3f4c35d1f40a.tar.gz
main-efadd6eda15122944d95e1b3f01c3f4c35d1f40a.tar.bz2
main-efadd6eda15122944d95e1b3f01c3f4c35d1f40a.zip
Commit
Diffstat (limited to 'metranslator/api.php')
-rw-r--r--metranslator/api.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/metranslator/api.php b/metranslator/api.php
index 0fe98b0..747686e 100644
--- a/metranslator/api.php
+++ b/metranslator/api.php
@@ -24,7 +24,10 @@ if (isset($_GET['u'])) {
die();
}
-$raw = json_decode(exec("bash -c 'cd /mnt/metranslator-api; node index.js api {$target} \"{$text}\"'"), true);
+$raw = json_decode(exec("cd /mnt/metranslator-api && node index.js api {$target} \"{$text}\""), true);
+$last = exec("cd /mnt/metranslator-api && git log -1 --pretty=format:'%an'");
$raw["system"]["version"] = $raw["system"]["version"] . "-" . substr(file_get_contents("/mnt/metranslator-api/.git/refs/heads/trunk"), 0, 8);
+$raw["system"]["last_author"] = $last;
+$raw["call"] = "cd /mnt/metranslator-api && node index.js api {$target} \"{$text}\"";
die(json_encode($raw)); \ No newline at end of file