From fb0c1c6993fc1aabf7a56f60a4078d903e34e13d Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Mon, 23 Aug 2021 19:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E8=A7=84=E5=88=99=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample/config.sample.sh | 3 +++ shell/share.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sample/config.sample.sh b/sample/config.sample.sh index 568e69dc..7863aa82 100644 --- a/sample/config.sample.sh +++ b/sample/config.sample.sh @@ -10,6 +10,9 @@ AutoDelCron="true" ## 在运行 ql repo 命令时,是否自动增加新的本地定时任务 AutoAddCron="true" +## 拉取脚本时默认的定时规则,当匹配不到定时规则时使用,例如: 0 9 * * * +DefaultCronRule="" + ## ql repo命令拉取脚本时需要拉取的文件后缀,直接写文件后缀名即可 RepoFileExtensions="js py" diff --git a/shell/share.sh b/shell/share.sh index fc1c23fb..c89a4e98 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -65,7 +65,12 @@ import_config() { command_timeout_time=${CommandTimeoutTime:-"1h"} github_proxy_url=${GithubProxyUrl:-""} file_extensions=${RepoFileExtensions:-"js py"} - default_cron="$(random_range 0 59) $(random_range 0 23) * * *" + + if [[ -n "${DefaultCronRule}" ]]; then + default_cron="${DefaultCronRule}" + else + default_cron="$(random_range 0 59) $(random_range 0 23) * * *" + fi } make_dir() {