diff --git a/README.md b/README.md index 4dc4f81..08ab62a 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,9 @@ Simple Rust Tests +Project or files: ``` . -├── LICENSE -├── README.md -├── README_template.md ├── __c_cpp │   ├── c_export │   └── cpp @@ -82,35 +80,32 @@ Simple Rust Tests │   ├── rweb │   ├── sincere │   └── warp -├── build_readme.js -├── build_summary ├── scripts │   └── commit-msg.crs -├── single_file_tests -│   ├── 99.htm -│   ├── 99.rs -│   ├── chain.rs -│   ├── closure.rs -│   ├── core_macro.rs -│   ├── display.rs -│   ├── for.rs -│   ├── format.rs -│   ├── input.rs -│   ├── lifecycle_str.rs -│   ├── list.rs -│   ├── loop.rs -│   ├── make_executable.rs -│   ├── match.rs -│   ├── rc.rs -│   ├── ref_n_and.rs -│   ├── sample.txt -│   ├── slice.rs -│   ├── time.rs -│   ├── vec.rs -│   └── while.rs -└── summary.md +└── single_file_tests + ├── 99.htm + ├── 99.rs + ├── chain.rs + ├── closure.rs + ├── core_macro.rs + ├── display.rs + ├── for.rs + ├── format.rs + ├── input.rs + ├── lifecycle_str.rs + ├── list.rs + ├── loop.rs + ├── make_executable.rs + ├── match.rs + ├── rc.rs + ├── ref_n_and.rs + ├── sample.txt + ├── slice.rs + ├── time.rs + ├── vec.rs + └── while.rs -77 directories, 28 files +77 directories, 26 files ``` diff --git a/README_template.md b/README_template.md index 42b26df..fd85cb2 100644 --- a/README_template.md +++ b/README_template.md @@ -2,6 +2,7 @@ Simple Rust Tests +Project or files: ``` $$TREE_L2$$ ``` diff --git a/build_readme.js b/build_readme.js index fe17552..b22b8c7 100755 --- a/build_readme.js +++ b/build_readme.js @@ -3,7 +3,18 @@ var main = () => { var readmeTemplate = __.rfile.from('README_template.md').string(); var tree = $$.shell().sh('tree -L 2').start()[0]; - __.rfile.from('README.md').write(readmeTemplate.replace('$$TREE_L2$$', tree)); + var treeLines = []; + var treeOrigLines = $STR(tree).split('\n'); + var ignoreFileList = ['LICENSE', 'README.md', 'README_template.md', 'build_readme.js']; + for (var i = 0; i < treeOrigLines.length; i++) { + var ln = treeOrigLines[i]; + var matches = false; + ignoreFileList.forEach((f) => { if (ln.endsWith(f)) { matches = true; } }); + if (!matches) { + treeLines.push(ln); + } + } + __.rfile.from('README.md').write(readmeTemplate.replace('$$TREE_L2$$', treeLines.join('\n'))); }; main();