Files
playlet-piped/scripts/screenshot.js
T
Brahim Hadriche 7a155c689e Sign app for publishing (#38)
* Sign app for publishing

* update gitignore

* refactor input args

* Change instance api sorting

* Better instance sorting

* Instance filter

* remove hardcoded instance

* script cleanups

* Unused function
2023-01-11 11:52:43 -05:00

30 lines
683 B
JavaScript

const rokuDeploy = require('roku-deploy');
const dotenv = require('dotenv');
const fs = require('fs');
const { exit } = require('process');
if(process.argv.length !== 3) {
console.error("Invalid usage! usage: npm run screenshot -- filename");
exit(-1);
}
const filename = process.argv[2];
const config = dotenv.parse(fs.readFileSync('.vscode/.env'));
const options = {
host: config.ROKU_DEV_TARGET,
password: config.ROKU_DEVPASSWORD,
outDir: '.',
outFile: filename
};
(async () => {
try {
await rokuDeploy.takeScreenshot(options);
console.log(`${filename} created`);
}
catch (error) {
console.error(error);
}
})();