Skip to content

Commit

Permalink
update gh-pages.js
Browse files Browse the repository at this point in the history
  • Loading branch information
semdy committed Jul 24, 2023
1 parent a674c08 commit 41242dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1,260 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Publish gh-pages
uses: JamesIves/[email protected]
with:
branch: main
folder: gh-pages
branch: gh-pages
folder: demo
clean: true
12 changes: 6 additions & 6 deletions gh-pages.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const fs = require("fs")
const path = require('path')
const ghPagesDir = path.resolve(__dirname, './gh-pages')
const demoDir = path.resolve(__dirname, './demo')
const htmlPath = path.resolve(__dirname, './index.html')
const libjsPath = path.resolve(__dirname, './lib/index.js')

function main() {
try {
if (fs.existsSync(ghPagesDir)) {
fs.rmSync(ghPagesDir, { recursive: true, force: true })
if (fs.existsSync(demoDir)) {
fs.rmSync(demoDir, { recursive: true, force: true })
}
fs.mkdirSync(ghPagesDir)
fs.copyFileSync(htmlPath, path.resolve(ghPagesDir, './index.html'))
fs.copyFileSync(libjsPath, path.resolve(ghPagesDir, './index.js'))
fs.mkdirSync(demoDir)
fs.copyFileSync(htmlPath, path.resolve(demoDir, './index.html'))
fs.copyFileSync(libjsPath, path.resolve(demoDir, './index.js'))
} catch(e) {
console.log(e)
process.exit(1)
Expand Down
102 changes: 0 additions & 102 deletions gh-pages/index.html

This file was deleted.

Loading

0 comments on commit 41242dc

Please sign in to comment.