Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected EncodeFile(FileSource: string, FileTarget: string): { Key: string; Iv: string } {
- const EncrypterExecutablePath = path.join(ProjectRelativeResourcePath, "_scripts/vendor/encrypter.exe");
- const Key = GenerateRandomString(16),
- IVKey = GenerateRandomString(16);
- const SourceRelative = Normalize(path.relative(Deno.cwd(), FileSource)),
- TargetRelative = Normalize(path.relative(Deno.cwd(), FileTarget)),
- OutPath = path.resolve(FileTarget, "../");
- console.log(SourceRelative)
- if (!fs.existsSync(OutPath)) fs.mkdirSync(OutPath, { recursive: true });
- spawnSync(EncrypterExecutablePath, [SourceRelative, TargetRelative, IVKey, Key], {
- cwd: Deno.cwd(),
- stdio: "inherit",
- });
- return { Key: Key, Iv: IVKey };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement