Spaces:
Running
Running
Commit
·
5b7a2c5
1
Parent(s):
b87a0a3
re-enabling ADD part of the watcher
Browse files- hf_server.js +13 -6
- omnitool_init.sh +1 -1
hf_server.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* All rights reserved.
|
4 |
*/
|
5 |
//@ts-check
|
6 |
-
const VERSION = '0.6.0.hf.014.
|
7 |
|
8 |
const express = require('express');
|
9 |
const http = require('http');
|
@@ -528,11 +528,18 @@ function startMirrorToDataDir()
|
|
528 |
.on('add', function(path) {
|
529 |
const targetFile = path.replace(sourceDir, targetDir);
|
530 |
console.warn(`TargetFile = ${targetFile}. File ${path} would have been added and copied from ${sourceDir} to ${targetDir}`);
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
536 |
})
|
537 |
.on('change', function(path) {
|
538 |
const targetFile = path.replace(sourceDir, targetDir);
|
|
|
3 |
* All rights reserved.
|
4 |
*/
|
5 |
//@ts-check
|
6 |
+
const VERSION = '0.6.0.hf.014.i';
|
7 |
|
8 |
const express = require('express');
|
9 |
const http = require('http');
|
|
|
528 |
.on('add', function(path) {
|
529 |
const targetFile = path.replace(sourceDir, targetDir);
|
530 |
console.warn(`TargetFile = ${targetFile}. File ${path} would have been added and copied from ${sourceDir} to ${targetDir}`);
|
531 |
+
try {
|
532 |
+
fs.copyFile(path, targetFile, (err) => {
|
533 |
+
if (err)
|
534 |
+
{
|
535 |
+
//throw err;
|
536 |
+
console.error('ERROR when doing: File', path, 'added -> copied to', targetFile);
|
537 |
+
}});
|
538 |
+
}
|
539 |
+
catch(error)
|
540 |
+
{
|
541 |
+
console.error(`WATCHER: error: ${error}`);
|
542 |
+
}
|
543 |
})
|
544 |
.on('change', function(path) {
|
545 |
const targetFile = path.replace(sourceDir, targetDir);
|
omnitool_init.sh
CHANGED
@@ -41,4 +41,4 @@ else
|
|
41 |
fi
|
42 |
|
43 |
echo "[->] YARN START "
|
44 |
-
yarn start -u -rb
|
|
|
41 |
fi
|
42 |
|
43 |
echo "[->] YARN START "
|
44 |
+
yarn start -u -rb -R blocks
|