39 lines
834 B
JavaScript
39 lines
834 B
JavaScript
const parseArgs = require('minimist');
|
|
const fs = require('fs');
|
|
const assert = require('assert');
|
|
|
|
class MyDoc {
|
|
|
|
constructor() {
|
|
this.workDir = './';
|
|
}
|
|
|
|
async init() {
|
|
await this.convert();
|
|
}
|
|
|
|
async convert() {
|
|
this.env = fs.readFileSync(`${this.workDir}env.json`, 'utf8');
|
|
let data = `
|
|
<?php5
|
|
class Doc
|
|
{
|
|
|
|
`;
|
|
if (fs.existsSync(`${this.workDir}README.php`)) {
|
|
data += fs.readFileSync(`${this.workDir}README.php`, 'utf8');
|
|
}
|
|
const files = fs.readdirSync('./', {encoding:'utf8', withFileTypes:true});
|
|
files.forEach((item) => {
|
|
if (item.name.slice(-3) == '.js' &&
|
|
item.name != 'common.js') {
|
|
//console.log(require('./' + item.name.slice(0, -3)));
|
|
console.log(require('/home/azw/pub/game2006go/doc/admin/User'));
|
|
}
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
(new MyDoc).init();
|