Skip to content

Instantly share code, notes, and snippets.

@gu3st
Last active April 22, 2019 03:30
Show Gist options
  • Save gu3st/2f4e3a6359c8d0301af55ace66fcba5f to your computer and use it in GitHub Desktop.
Save gu3st/2f4e3a6359c8d0301af55ace66fcba5f to your computer and use it in GitHub Desktop.
Helpful script!
#!/usr/bin/env node
const childProcess = require('child_process')
const warning = "THIS IS A LESSON. DON'T EXECUTE ARBITRARY SCRIPTS";
const open = (process.platform === 'linux' ? "xdg-open" : "open");
console.log(warning);
try{
childProcess.exec(`${open} "https://www.youtube.com/watch?v=dQw4w9WgXcQ"`);
if(process.platform === 'darwin') {
childProcess.exec(`osascript -e 'set Volume 50'`)
childProcess.exec(`say ${warning}`);
}
}
catch(e){
console.log(warning);
}
{
"name": "helpful-script",
"version": "0.0.2",
"bin": "./helpful.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment