Closed baltpeter closed 1 year ago
One thing to consider: It's plausible that someone might delete this cache directory without re-running the postinstall
script, which would break the module. This could already happen with the current implementation, but I feel like it's more likely if we use a cache directory.
Not too hard to work around, though: We can just check whether the necessary files exist and run the postinstall
script otherwise.
Yeah, that seems reasonable to me. I am just not sure where we would put this check. In startAnalysis
?
I am just not sure where we would put this check. In
startAnalysis
?
Yeah, that seems reasonable to me.
Actually, I went with startTrafficCollection()
, since startAnalysis()
isn't async and we only need those dependencies for the traffic collection.
This change has fixed the CLI for me.
Actually, I went with
startTrafficCollection()
, sincestartAnalysis()
isn't async and we only need those dependencies for the traffic collection.
Okay, never mind. We need to set the PATH
up correctly for ensureFrida()
, so we do need to make startAnalysis()
async.
Putting the venv and mitmproxy scripts into our
node_modules
folder (relative to__dirname
) is unfortunately quite fragile. We've already had a fair amount of breakage due to this and while reviewing #17, I once again noticed this breaking.For some bizarre reason,
__dirname
is/home/benni/coding/JS/tweasel/cyanoacrylate/dist/src
, even though that folder doesn't exist (the builtindex.js
is indist
, deleting that and the Parcel cache didn't help).I propose that we instead put this stuff into the system cache folder using global-cache-dir. That feels more idiomatic, anyway.
Additional benefit: If we want to distribute a single executable at some point, there won't be a
node_modules
folder that we can write to, anyway.What do you think, @zner0L?