sc4
Version:
A command line utility for automating SimCity 4 modding tasks & modifying savegames
27 lines (26 loc) • 853 B
JavaScript
// # plugin-index.browser.ts
import CorePluginIndex, {} from './plugin-index.js';
import { Glob } from './glob.browser.js';
// # PluginIndex()
export default class PluginIndex extends CorePluginIndex {
installation;
plugins;
constructor(opts = {}) {
super(opts);
if (opts.installation)
this.installation = opts.installation;
if (opts.plugins)
this.plugins = opts.plugins;
}
// ## createGlob()
// This method must be implemented when extending a core plugin index. It
// should return an async iterable that traverses all dbpfs in a directory
// and yields the proper dbpf constructor options - a buffer, a file path or
// a File object.
createGlob(pattern, cwd) {
return new Glob(pattern, {
cwd,
nocase: true,
});
}
}