diff --git a/shell/git_diy.sh b/shell/git_diy.sh index 3f497953..dcc7bbb1 100755 --- a/shell/git_diy.sh +++ b/shell/git_diy.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash #author:spark thanks to: https://github.com/sparkssssssss/scripts +ShellDir=${QL_DIR:-$( + cd $(dirname $0) + pwd +)} +[[ $QL_DIR ]] && ShellJs=js + declare -A BlackListDict author=$1 repo=$2 diff --git a/shell/git_pull.sh b/shell/git_pull.sh index 82c434a1..75b8d684 100755 --- a/shell/git_pull.sh +++ b/shell/git_pull.sh @@ -233,7 +233,8 @@ Add_Cron() { JsAdd=$(cat $ListJsAdd) for Cron in $JsAdd; do if [[ $Cron == jd_bean_sign ]]; then - echo "4 0,9 * * * $ShellJs $Cron" >>$ListCronCurrent + local name=$(cat "$ScriptsDir/$Cron.js" | grep -E "new Env\(" | perl -pe "s|(^.+)new Env\(\'*\"*(.+?)'*\"*\).+|\2|") + add_cron_api "4 0,9 * * *" "$ShellJs $Cron" "$name" else local name=$(cat "$ScriptsDir/$Cron.js" | grep -E "new Env\(" | perl -pe "s|(^.+)new Env\(\'*\"*(.+?)'*\"*\).+|\2|") local param=$(cat $ListCronRemote | grep -E "\/$Cron\." | perl -pe "s|(^.+) node */scripts/(j[drx]_\w+)\.js.+|\1\:$ShellJs \2|")