Don't rebuild cached source files on Windows
import glob from "glob";
import { promisify } from "util";
+import { pathExists } from "fs-extra";
const globAsync = promisify(glob);
@@ -23,10 +24,17 @@ export default async (
const buildFiles = await globAsync(srcRoot);
for (const file of buildFiles) {
- const objFile = `${file.replace(/src.*\//, "obj/").replace(/\.[cs]$/, "")}.o`;
- if(file.indexOf("data/bank_") == -1 && file.indexOf("music/music_bank_") == -1) {
+ const objFile = `${file
+ .replace(/src.*\//, "obj/")
+ .replace(/\.[cs]$/, "")}.o`;
+ if (
+ file.indexOf("data/bank_") === -1 &&
+ file.indexOf("music/music_bank_") === -1
+ ) {
+ if (!(await pathExists(objFile))) {
cmds.push(`${CC} ${CFLAGS} -c -o ${objFile} ${file}`);
}
+ }
objFiles.push(objFile);
}
