hexo-theme-ayer/move_config.js

12 lines
417 B
JavaScript
Raw Normal View History

2020-08-24 04:20:00 +00:00
const fs = require('fs')
if (fs.existsSync('../hexo/package.json')) {
const version = JSON.parse(fs.readFileSync('../hexo/package.json')).version
if (version.split('.')[0] === '5') {
const configPath = '../../_config.ayer.yml'
if (!fs.existsSync(configPath)) {
fs.writeFileSync(configPath, fs.readFileSync('./_config.yml'))
}
fs.unlinkSync('./_config.yml')
}
}