1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-15 02:57:15 +02:00

Support for automated git sync with a theme repo.

This commit is contained in:
Cameron
2019-06-11 10:09:41 -07:00
parent a6009d5957
commit 2337f8e678
4 changed files with 56 additions and 5 deletions

View File

@@ -63,6 +63,39 @@ class _system_cron
$fl->chmod(e_BASE."cron.php",0755);
$fl->chmod(e_HANDLER."bounce_handler.php",0755);
}
/**
* Update the current Theme Repo
* When using private repos on Github, you'll need to get a personal access token @see https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
* (with 'repo' access) and then modify the .git/config file :
* @example:
* [remote "origin"]
* url = https://[TOKEN]@github.com/[USER]/[REPO].git
*/
function gitrepoTheme()
{
$mes = e107::getMessage();
$fl = e107::getFile();
$theme = e107::getPref('sitetheme');
if(is_dir(e_THEME.$theme."/.git")) // Check it's a Git Repo
{
$return = $fl->gitPull($theme, 'theme');
$mes->addSuccess($return);
}
else
{
$mes->addError("No git repo found in theme folder"); //TODO LAN
}
}