migrate cookie length condition out to shell from core

This commit is contained in:
bossgeekgo
2024-02-12 10:38:35 +08:00
parent 978b6d2105
commit 8c0257e93a
2 changed files with 5 additions and 6 deletions

View File

@@ -20,11 +20,6 @@ const { cookies: bossCookies } = readConfigFile('boss.json')
const targetCompanyList = readConfigFile('target-company-list.json')
if (!bossCookies?.length) {
console.error('There is no cookies. you can save a copy with EditThisCookie extension.')
process.exit(1)
}
const recommendJobPageUrl = `https://www.zhipin.com/web/geek/job-recommend`
const expectCompanySet = new Set(targetCompanyList)

View File

@@ -9,7 +9,7 @@ import path from 'node:path'
import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs';
import JSON5 from 'json5'
import { readConfigFile } from '@bossgeekgo/geek-auto-start-chat-with-boss/runtime-file-utils.mjs'
const { cookies: bossCookies } = readConfigFile('boss.json')
const { groupRobotAccessToken: dingTalkAccessToken } = readConfigFile('dingtalk.json')
const initPlugins = (hooks) => {
@@ -17,6 +17,10 @@ const initPlugins = (hooks) => {
}
;(async () => {
if (!bossCookies?.length) {
console.error('There is no cookies. You can save a copy with EditThisCookie extension.')
process.exit(1)
}
const hooks = {
puppeteerLaunched: new SyncHook(),
pageLoaded: new SyncHook(),