[MIRROR] Fix tgui reloading (#3960)

* Fix tgui reloading (#57499)

* Fix tgui reloading

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
SkyratBot
2021-03-07 00:36:14 +00:00
committed by GitHub
co-authored by Aleksej Komarov
parent b24e1530f7
commit 599ef86bd4
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -7,6 +7,9 @@
#Ignore byond config folder.
/cfg/**/*
# Ignore compiled linux libs in the root folder, e.g. librust_g.so
/*.so
#Ignore compiled files and other files generated during compilation.
*.mdme
*.dmb
+3 -3
View File
@@ -67,7 +67,7 @@ export const findCacheRoot = async () => {
const onCacheRootFound = cacheRoot => {
logger.log(`found cache at '${cacheRoot}'`);
// Plant dummy
// Plant a dummy
fs.closeSync(fs.openSync(cacheRoot + '/dummy', 'w'));
};
@@ -94,12 +94,12 @@ export const reloadByondCache = async bundleDir => {
const garbage = await resolveGlob(cacheDir, './*.+(bundle|chunk|hot-update).*');
try {
for (let file of garbage) {
fs.unlink(file);
fs.unlinkSync(file);
}
// Copy assets
for (let asset of assets) {
const destination = resolvePath(cacheDir, basename(asset));
fs.copyFile(asset, destination);
fs.writeFileSync(destination, fs.readFileSync(asset));
}
logger.log(`copied ${assets.length} files to '${cacheDir}'`);
}