Files
playlet-piped/tools/screenshot.js
T
Brahim Hadricheandgithub-action linter 9d8a3d1cea Create Component Library (#43)
* Move src under playlet-lib

* Update configuration

* Update script

* Update script

* Working version

* Vs code config WIP

* Package lock sync

* Lint fix

* Fix images

* Reuse config files

* Kind of a working setup

* Lock node version

* Rename scripts to tools

* Fix build scripts, lib url system

* Lint fix

* rale

* Fix args and web server

* Load fallbacks and build script cleanups

* Remove unused method

* no message

* no message

* Remove generic message field

* Lint fix

* no message

* Use loading indicator on main app

* Add playlet lib version to settings

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-01-29 16:50:28 -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);
}
})();