From ccc7d9956559d2195e20345e7a794662b52cd403 Mon Sep 17 00:00:00 2001 From: Agando Date: Sat, 6 Jun 2026 06:00:27 +0200 Subject: auto: 2026-06-06_06:00 changes --- modules/ext/editor.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules/ext/editor.js') diff --git a/modules/ext/editor.js b/modules/ext/editor.js index 8c3ac0f..3a5f269 100644 --- a/modules/ext/editor.js +++ b/modules/ext/editor.js @@ -44,6 +44,17 @@ class EditorModule { const ok = this.terminal.fs.writeFile(this._vfsPath, code); if (ok) { this.terminal.print('✅ Saved to ' + this._vfsPath, 'success'); + // Mirror to _mods/ for test_module compatibility + const modMatch = this._vfsPath.match(/(?:^|\/)(\w+)\.js$/); + if (modMatch) { + const modName = modMatch[1]; + this.terminal.fs.mkdirRecursive('_mods'); + this.terminal.fs.writeFile('_mods/' + modName + '.js', code); + if (!this.terminal.fs.readFile('_mods/' + modName + '.orig.js')) { + this.terminal.fs.writeFile('_mods/' + modName + '.orig.js', 'placeholder'); + } + this.terminal.print('📋 Mirrored to _mods/' + modName + '.js for live testing', 'info'); + } // Notify tutorial module for quest 4 (edit + save) if (this.terminal.tutorialModule) { this.terminal.tutorialModule.onFileSaved(this._vfsPath); -- cgit v1.2.3