redoc/build/prepare_deploy.js

29 lines
701 B
JavaScript
Raw Normal View History

2016-05-20 22:37:10 +03:00
#!/usr/bin/env node
'use strict';
require('shelljs/global');
var paths = require('./paths');
var path = require('path');
2016-05-29 20:47:38 +03:00
set('-e');
set('-v');
2016-05-20 22:37:10 +03:00
// build
exec('npm run build-dist');
cd('demo');
2016-08-29 07:34:08 +03:00
mv('index-gh.html', 'index.html');
2016-05-20 22:37:10 +03:00
mkdir('-p', 'dist');
cp('-R', '../dist/*', './dist/');
cd('..');
2016-05-29 20:47:38 +03:00
2016-05-20 22:37:10 +03:00
var version = 'v' + require(path.join(__dirname, '../package.json')).version + '/';
var versionDir = path.join(paths.releases, version);
2016-05-29 20:47:38 +03:00
var latestDir = path.join(paths.releases, 'latest/');
2016-09-13 01:35:00 +03:00
var v1Dir = path.join(paths.releases, 'v1.x.x/');
2016-05-20 22:37:10 +03:00
mkdir('-p', versionDir)
2016-05-29 20:47:38 +03:00
mkdir('-p', latestDir);
2016-08-29 09:36:53 +03:00
mkdir('-p', v1Dir);
2016-08-30 20:15:52 +03:00
cp(paths.redocBuilt, versionDir);
cp(paths.redocBuilt, latestDir);
cp(paths.redocBuilt, v1Dir);