feat: Exposing the rsync that we have to the js (#1907)

chore: Make the commit do by checksum.

chore: Remove the logging at the start

chore: use the defaults of the original.

chore: Convert the error into just the source.

chore: Remove some of the unwraps
This commit is contained in:
J M
2022-11-09 12:19:08 -07:00
committed by Aiden McClelland
parent 0e82b6981f
commit 67b54ac1eb
32 changed files with 2001 additions and 439 deletions

View File

@@ -915,4 +915,63 @@ export const action = {
},
};
},
/**
* Want to test that rsync works
* @param {*} effects
* @param {*} _input
* @returns
*/
async "test-rsync"(effects, _input) {
try {
await effects
.removeDir({
volumeId: "main",
path: "test-rsync-out",
})
.catch(() => {});
const runningRsync = effects.runRsync({
srcVolume: "main",
srcPath: "testing-rsync",
dstVolume: "main",
dstPath: "test-rsync-out",
options: {
delete: true,
force: true,
ignoreExisting: false,
}
});
assert(await runningRsync.id() >= 1, "Expect that we have an id");
const progress = await runningRsync.progress()
assert(progress >= 0 && progress <= 1, `Expect progress to be 0 <= progress(${progress}) <= 1`);
await runningRsync.wait();
assert((await effects.readFile({
volumeId: "main",
path: "test-rsync-out/testing-rsync/someFile.txt",
})).length > 0, 'Asserting that we read in the file "test_rsync/test-package/0.3.0.3/embassy.js"');
return {
result: {
copyable: false,
message: "Done",
version: "0",
qr: false,
},
};
}
catch (e) {
throw e;
}
finally {
await effects
.removeDir({
volumeId: "main",
path: "test-rsync-out",
})
.catch(() => {});
}
},
};

View File

@@ -0,0 +1 @@
Here's something in this file for the rsync