diff --git a/bin/pre_script.dart b/bin/pre_script.dart index da022f9..bbf0029 100644 --- a/bin/pre_script.dart +++ b/bin/pre_script.dart @@ -52,6 +52,12 @@ void walkPath(FileSystemEntity path) { // 默认代码块开始 if (tmp.isNotEmpty) { sb.write(tmp); + print([ + "${file!.path} modified", + "-" * 80, + tmp.toString(), + "-" * 80, + ].join("\n")); state = STATE.replace; } else { state = STATE.none; @@ -82,8 +88,8 @@ void walkPath(FileSystemEntity path) { } }); if (modified) { - // file!.renameSync(path.path + '.bak'); - // File(path.path).writeAsStringSync(sb.toString(), flush: true); + file!.renameSync(path.path + '.bak'); + File(path.path).writeAsStringSync(sb.toString(), flush: true); print(sb.toString()); } } catch (e) {