Skip to content

Commit

Permalink
[MIRROR] Fix tgui reloading (#3960)
Browse files Browse the repository at this point in the history
* Fix tgui reloading (#57499)

* Fix tgui reloading

Co-authored-by: Aleksej Komarov <[email protected]>
SkyratBot and stylemistake authored Mar 7, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b24e153 commit 599ef86
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions tgui/packages/tgui-dev-server/reloader.js
Original file line number Diff line number Diff line change
@@ -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}'`);
}

0 comments on commit 599ef86

Please sign in to comment.