Skip to content

Commit c4d1b0c

Browse files
committed
pull in replaceAll fix from refactor/watch-native
Signed-off-by: Trae Yelovich <[email protected]>
1 parent 7db94de commit c4d1b0c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

native/c/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ libztso.a: ztso.o
246246
zowex: zowex.o libzcn.a libzut.a libzjb.a libzds.a libzusf.a libztso.a
247247
@echo 'Building zowex'
248248
$(CXX) $(CPP_BND_FLAGS) -o $@ $^ > $*.bind.lst
249-
ln -sf $@ ../golang/$(basename $@) || true
249+
ln -sf $@ ../golang/$(basename $@)
250250
@echo 'Copied zowex to golang/'
251251

252252
zowexx: zowex.o libzcn.a libzut.a libzjb.a libzds.a libzusf.a libztso.a
253253
@echo 'Building zowexx'
254254
$(CXX) $(CPP_BND_FLAGS_AUTH) -o $@ $^ > $*.bind.lst
255-
ln -sf $@ ../golang/$(basename $@) || true
255+
ln -sf $@ ../golang/$(basename $@)
256256
@echo 'Copied zowexx to golang/'
257257

258258
zowex.o: zowex.cpp

scripts/watchNative.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ async function deleteFile(remotePath) {
125125
}
126126

127127
conn.sftp((err, sftp) => {
128-
sftp
129-
.deleteFile(remotePath)
130-
.then((res) => resolve())
131-
.catch((err) => console.log(err) && resolve());
128+
sftp.unlink(remotePath, (err) => {
129+
if (err) {
130+
return reject(err);
131+
}
132+
133+
resolve();
134+
});
132135
});
133136
});
134137
}
@@ -183,7 +186,7 @@ watcher.on("add", async (path, stats) => {
183186
try {
184187
await uploadFile(
185188
path,
186-
p.posix.join(config.deployDirectory, path.replace(p.sep, p.posix.sep))
189+
p.posix.join(config.deployDirectory, path.replaceAll(p.sep, p.posix.sep))
187190
);
188191
} catch (err) {
189192
console.error(" ✘", err);
@@ -195,18 +198,18 @@ watcher.on("change", async (path, stats) => {
195198
try {
196199
await uploadFile(
197200
path,
198-
p.posix.join(config.deployDirectory, path.replace(p.sep, p.posix.sep))
201+
p.posix.join(config.deployDirectory, path.replaceAll(p.sep, p.posix.sep))
199202
);
200203
} catch (err) {
201204
console.error(" ✘", err);
202205
}
203206
});
204207

205208
watcher.on("unlink", async (path, stats) => {
206-
process.stdout.write(`${Date.now().toLocaleString()} [-] ${path}`);
209+
process.stdout.write(`${new Date().toLocaleString()} [-] ${path}`);
207210
try {
208211
await deleteFile(
209-
p.posix.join(config.deployDirectory, path.replace(p.sep, p.posix.sep))
212+
p.posix.join(config.deployDirectory, path.replaceAll(p.sep, p.posix.sep))
210213
);
211214
} catch (err) {
212215
console.error(" ✘", err);

0 commit comments

Comments
 (0)