-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Expand file tree
/
Copy pathpreghpages.js
More file actions
executable file
·33 lines (25 loc) · 783 Bytes
/
preghpages.js
File metadata and controls
executable file
·33 lines (25 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
const path = require('path');
const shell = require('shelljs');
const replaceInFileSync = require('replace-in-file').replaceInFileSync;
const pkg = require('../package.json');
const threeVersion = pkg.dependencies.three.split('@')[1];
const rootDir = path.join(__dirname, '..');
shell.cd(rootDir);
shell.rm('-rf', 'gh-pages');
shell.mkdir('-p', 'gh-pages');
shell.cp('-r', [
'.nojekyll',
'dist',
'examples',
'*.md'
], 'gh-pages');
function htmlReplace (before, after) {
replaceInFileSync({
from: before,
to: after,
files: 'gh-pages/**/*.html'
});
}
htmlReplace('dist/aframe-master.js', 'dist/aframe-master.min.js');
htmlReplace(/\.\.\/\.\.\/\.\.\/super-three-package/g, `https://cdn.jsdelivr.net/npm/super-three@${threeVersion}`);