scenery-io / stallion

Scripting bridge for Cavalry
https://marketplace.visualstudio.com/items?itemName=Scenery.cavalry-bridge
MIT License
9 stars 0 forks source link

Encrypt scripts #3

Open Klustre opened 3 months ago

Klustre commented 3 months ago

Send script and encrypt. Save alongside a saved script or otherwise prompt for an output path.

For now, send this snippet to Cavalry. Make sure to change the inputPath and outputPath.

const inputPath = '/absolute/path/to/file.js'
const outputPath = '/absolute/path/to/outfile.jsc'
const content = api.readFromFile(inputPath)
const encrypted = api.encrypt(content)
const success = api.writeToFile(outputPath, encrypted, true)
console.log(JSON.stringify({success}))