no message
This commit is contained in:
parent
a2e17d7ad3
commit
c90aee374b
@ -161,14 +161,14 @@ class CronController
|
||||
|
||||
// 检查文件是否存在,如果不存在则创建
|
||||
if (!file_exists($sshConfigFile)) {
|
||||
// touch($sshConfigFile);
|
||||
touch($sshConfigFile);
|
||||
}
|
||||
|
||||
// 追加配置到文件
|
||||
file_put_contents($sshConfigFile, $config, FILE_APPEND | LOCK_EX);
|
||||
|
||||
// 设置文件权限
|
||||
// chmod($sshConfigFile, 0600);
|
||||
chmod($sshConfigFile, 0600);
|
||||
|
||||
echo "SSH config updated successfully.\n";
|
||||
|
||||
@ -221,6 +221,10 @@ class CronController
|
||||
// 添加远程仓库
|
||||
$this->runCommand("git remote add origin \"{$this->sProjectUrl}\"");
|
||||
|
||||
// 立即拉取覆盖一次
|
||||
$this->runCommand("git fetch origin");
|
||||
$this->runCommand("git reset --hard origin/main");
|
||||
|
||||
echo "操作完成:以初始化仓库[".$this->aArticle['id']."]。\n";
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user