Merge pull request #1102 from GZTimeWalker/patch-1

fix: `TypeError: require(...) is not a function` when setup
This commit is contained in:
Jerry Wong
2022-11-18 13:32:47 +08:00
committed by GitHub
Unverified
2 changed files with 9 additions and 12 deletions
+1 -2
View File
@@ -1,8 +1,7 @@
const logger = require('hexo-log')()
hexo.extend.filter.register('before_generate', () => {
// Get first two digits of the Hexo version number
const hexoVer = hexo.version.replace(/(^.*\..*)\..*/, '$1')
const logger = hexo.log
if (hexoVer < 5.3) {
logger.error('Please update Hexo to V5.3.0 or higher!')
+8 -10
View File
@@ -1,16 +1,14 @@
const logger = require('hexo-log')()
hexo.on('ready', () => {
const { version } = require('../../package.json')
logger.info(`
hexo.log.info(`
===================================================================
##### # # ##### ##### ###### ##### ###### # # #
# # # # # # # # # # # # #
##### # # # # ##### # # ##### # #
# # # # # # # ##### # # #
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #
##### # # ##### ##### ###### ##### ###### # # #
# # # # # # # # # # # # #
##### # # # # ##### # # ##### # #
# # # # # # # ##### # # #
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #
${version}
===================================================================`)