#!/usr/bin/env node
"use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}(()=>{var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};e.r(i);const n=require("child_process"),l=require("path"),o=(e,i={})=>(0,n.execSync)(e,{encoding:"utf-8",shell:"/bin/bash",...i});if(o("git branch").includes("* main")){console.info("Build new web page."),o("yarn build");const e=o("pwd"),i=(0,l.resolve)(e,"../",`${(0,l.basename)(e)}.github.io`);let n="./",a="./";o("git branch").includes("gh-pages")?(console.info("Checkout distribution branch."),o("git checkout gh-pages")):i?(n=`${i}/build/`,a=i):console.warn("No website target found."),console.info("Update page data."),o(`\n        rsync             './build/' '${n}'             $ILU_RSYNC_DEFAULT_ARGUMENTS             --exclude=CNAME             --exclude='.*'             --exclude=node_modules             --exclude=readme.md             --exclude=./build\n    `),o("rm --recursive --force ./build"),console.info("Upload compiled webpage"),o("git pull",{cwd:a}),o("git add --all",{cwd:a}),o("git commit --message 'Automatic page build update.'",{cwd:a}),o("git push",{cwd:a}),o("git branch").includes("gh-pages")?console.info("Switch back to source directory."):(console.info("Switch back to main branch."),o("git checkout main"))}module.exports=i})();