diff options
| author | Agando <roduccomm@gmail.com> | 2026-06-06 06:00:27 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-06-06 06:00:27 +0200 |
| commit | ccc7d9956559d2195e20345e7a794662b52cd403 (patch) | |
| tree | 757354fbfec5c75b4577b2cb620d5ab1582e19b1 /modules/ext/editor.js | |
| parent | b538577cd0a4292e4cd4ca1c9f9829fc7e133caa (diff) | |
auto: 2026-06-06_06:00 changes
Diffstat (limited to 'modules/ext/editor.js')
| -rw-r--r-- | modules/ext/editor.js | 11 |
1 files changed, 11 insertions, 0 deletions
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); |