mirror of
https://github.com/smogon/sprites.git
synced 2026-04-18 15:57:19 -05:00
- fuse and wine do not get along. - This is the absolute final release of DeflOpt, and it is only accessible in binary form via archive.org, so we vendored it.
21 lines
571 B
JavaScript
21 lines
571 B
JavaScript
// Run DeflOpt.exe.
|
|
// Wine and Tup's fuse filesystem don't play nicely together.
|
|
// Copy inputs to /tmp first.
|
|
|
|
import {asTmp} from './tmp.js';
|
|
import {deflopt} from './deflopt.js';
|
|
|
|
const exe = process.argv[2];
|
|
const src = process.argv[3];
|
|
if (src === undefined || exe === undefined) {
|
|
throw new Error('tools/deflopt <path to DeflOpt.exe> <file>');
|
|
}
|
|
|
|
asTmp("deflopt", src, dst => {
|
|
const {processed, rewritten} = deflopt(exe, dst);
|
|
if (processed !== 1) {
|
|
throw new Error(`Didn't process any files.`);
|
|
}
|
|
return {changed: rewritten > 0};
|
|
});
|