Update: MicroPython使用AST构建下py文件抽象语法树以精确解析模块依赖
This commit is contained in:
@@ -100,26 +100,29 @@ if (fs_plus.isDirectorySync(DEFAULT_SRC_DIR)) {
|
||||
}
|
||||
}
|
||||
|
||||
const DEFAULT_DIR = path.resolve(ORIGIN_DIR, 'boards/default');
|
||||
|
||||
if (fs_plus.isDirectorySync(DEFAULT_DIR)) {
|
||||
const names = fs.readdirSync(DEFAULT_DIR);
|
||||
for (let name of names) {
|
||||
if (!['all', name].includes(options.type)) {
|
||||
continue;
|
||||
if (!!options.obfuscate) {
|
||||
const DEFAULT_DIR = path.resolve(ORIGIN_DIR, 'boards/default');
|
||||
|
||||
if (fs_plus.isDirectorySync(DEFAULT_DIR)) {
|
||||
const names = fs.readdirSync(DEFAULT_DIR);
|
||||
for (let name of names) {
|
||||
if (!['all', name].includes(options.type)) {
|
||||
continue;
|
||||
}
|
||||
const now = path.resolve(DEFAULT_DIR, name);
|
||||
if (!fs_plus.isDirectorySync(now)) {
|
||||
continue;
|
||||
}
|
||||
const examplesPath = path.resolve(now, 'examples');
|
||||
if (!fs_plus.isDirectorySync(examplesPath)) {
|
||||
continue;
|
||||
}
|
||||
let outputPath = path.resolve(examplesPath, 'map.json');
|
||||
let output = getExamples(examplesPath, !!options.obfuscate);
|
||||
fs_extra.outputJsonSync(outputPath, output, {
|
||||
spaces: ' '
|
||||
});
|
||||
}
|
||||
const now = path.resolve(DEFAULT_DIR, name);
|
||||
if (!fs_plus.isDirectorySync(now)) {
|
||||
continue;
|
||||
}
|
||||
const examplesPath = path.resolve(now, 'examples');
|
||||
if (!fs_plus.isDirectorySync(examplesPath)) {
|
||||
continue;
|
||||
}
|
||||
let outputPath = path.resolve(examplesPath, 'map.json');
|
||||
let output = getExamples(examplesPath, !!options.obfuscate);
|
||||
fs_extra.outputJsonSync(outputPath, output, {
|
||||
spaces: ' '
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user