diff --git a/.gitignore b/.gitignore index c8599a6..08120d2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ public/ .deploy*/ .vercel yarn.lock +theme/*/yarn.lock !node_modules/hexo-renderer/postcss2 \ No newline at end of file diff --git a/themes/suka/scripts/index.js b/themes/suka/scripts/index.js index 652ae20..2c18191 100644 --- a/themes/suka/scripts/index.js +++ b/themes/suka/scripts/index.js @@ -1,5 +1,23 @@ +function main(){getos((e,os)=>{ + if(e) throw new Error(e); + if(os.os === "linux"){ + if(os.release == undefined){ + globalThis.buildEnvironment = `${os.dist} @ Node.js ${process.version}` + }else{ + globalThis.buildEnvironment = `${os.dist} ${os.release} @ Node.js ${process.version}` + } + }else{ + globalThis.buildEnvironment = `${os.os} @ Node.js ${process.version}`; + } + console.log(`Running in ${globalThis.buildEnvironment}`); + return globalThis.buildEnvironment; +})} + +main(); + /* global hexo */ + // Welcome Message require('../includes/tasks/welcome'); // Check Hexo Version @@ -33,21 +51,6 @@ exec('git log --pretty=format:"%ct" HEAD -1',(err,stdout, stderr)=>{ console.log(`CommitTime: ${stdout}`); }) -globalThis.buildEnvironment = getos((e,os)=>{ - if(e) throw new Error(e); - if(os.os === "linux"){ - if(os.release == undefined){ - globalThis.buildEnvironment = `${os.dist} @ Node.js ${process.version}` - }else{ - globalThis.buildEnvironment = `${os.dist} ${os.release} @ Node.js ${process.version}` - } - }else{ - globalThis.buildEnvironment = `${os.os} @ Node.js ${process.version}`; - } - console.log(`Running in ${globalThis.buildEnvironment}`); - return globalThis.buildEnvironment; -}) - // Debug helper hexo.extend.helper.register('console', function () { console.log(arguments);