change folder name to compiled_tests

This commit is contained in:
Tony Brix 2018-01-02 13:57:24 -06:00
parent 31005193a7
commit 951f2c3916
2 changed files with 8 additions and 8 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
node_modules/ node_modules/
test/tests test/compiled_tests

View File

@ -19,7 +19,7 @@ var fs = require('fs')
*/ */
function load() { function load() {
var dir = __dirname + '/tests' var dir = __dirname + '/compiled_tests'
, files = {} , files = {}
, list , list
, file , file
@ -320,7 +320,7 @@ function time(options) {
*/ */
function fix() { function fix() {
['tests', 'original', 'new'].forEach(function(dir) { ['compiled_tests', 'original', 'new'].forEach(function(dir) {
try { try {
fs.mkdirSync(path.resolve(__dirname, dir), 0755); fs.mkdirSync(path.resolve(__dirname, dir), 0755);
} catch (e) { } catch (e) {
@ -329,8 +329,8 @@ function fix() {
}); });
// rm -rf tests // rm -rf tests
fs.readdirSync(path.resolve(__dirname, 'tests')).forEach(function(file) { fs.readdirSync(path.resolve(__dirname, 'compiled_tests')).forEach(function(file) {
fs.unlinkSync(path.resolve(__dirname, 'tests', file)); fs.unlinkSync(path.resolve(__dirname, 'compiled_tests', file));
}); });
// cp -r original tests // cp -r original tests
@ -339,12 +339,12 @@ function fix() {
if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.') === 0) { if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.') === 0) {
nfile = file.replace(/([^.]+)$/, 'nogfm.$1'); nfile = file.replace(/([^.]+)$/, 'nogfm.$1');
} }
fs.writeFileSync(path.resolve(__dirname, 'tests', nfile), fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', nfile),
fs.readFileSync(path.resolve(__dirname, 'original', file))); fs.readFileSync(path.resolve(__dirname, 'original', file)));
}); });
// node fix.js // node fix.js
var dir = __dirname + '/tests'; var dir = __dirname + '/compiled_tests';
fs.readdirSync(dir).filter(function(file) { fs.readdirSync(dir).filter(function(file) {
return path.extname(file) === '.html'; return path.extname(file) === '.html';
@ -400,7 +400,7 @@ function fix() {
// cp new/* tests/ // cp new/* tests/
fs.readdirSync(path.resolve(__dirname, 'new')).forEach(function(file) { fs.readdirSync(path.resolve(__dirname, 'new')).forEach(function(file) {
fs.writeFileSync(path.resolve(__dirname, 'tests', file), fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file),
fs.readFileSync(path.resolve(__dirname, 'new', file))); fs.readFileSync(path.resolve(__dirname, 'new', file)));
}); });
} }