Last active
April 22, 2019 03:30
-
-
Save gu3st/2f4e3a6359c8d0301af55ace66fcba5f to your computer and use it in GitHub Desktop.
Helpful script!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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