Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BrOrlandi committed Nov 14, 2016
0 parents commit 6343430
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Binary file added faustao-errou.mp3
Binary file not shown.
Binary file added faustao-errou.ogg
Binary file not shown.
12 changes: 12 additions & 0 deletions forWindows.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Dim oPlayer
Set oPlayer = CreateObject("WMPlayer.OCX")

' Play audio
oPlayer.URL = "C:\welcome.mp3"
oPlayer.controls.play
While oPlayer.playState <> 1 ' 1 = Stopped
WScript.Sleep 100
Wend

' Release the audio file
oPlayer.close
28 changes: 28 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

const exect = require('child_process').exec;

const faustaoErrou = function (){
const linuxcmd = 'paplay faustao-errou.ogg';
const windowscmd = 'forWindows.vbs';

const platform = process.platform;

if(platform === 'linux'){
exec(linuxcmd);
}
else if(platform === 'win32'){
exec(windowscmd);
}

function exec(cmd){
exect(cmd, function (error, stdout, stderr) {
console.log(stdout);
});
}
}

module.exports = faustaoErrou;

if (!module.parent) {
faustaoErrou();
}
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "faustao-errou",
"version": "1.0.0",
"description": "Errrrooooouuuuuu!",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"author": "Bruno Orlandi <[email protected]>",
"license": "MIT"
}

0 comments on commit 6343430

Please sign in to comment.