Last active
September 30, 2016 18:35
-
-
Save gdoteof/9d1f195c342f0600ad9f6cae9a041205 to your computer and use it in GitHub Desktop.
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
var spawn = require('child_process').spawn; | |
var test = spawn('./test.sh', ['--fashion-last "purestyle_lists/MASTER 9.28.16.csv" "purestyle_lists/men_tracker_master.csv"', '--ecomm-last "purestyle_lists/men_selling_master.csv"']); | |
test.stdout.on('data', (data) => { | |
console.log(`stdout: ${data}`); | |
}); | |
test.stderr.on('data', (data) => { | |
console.log(`stderr: ${data}`); | |
}); | |
test.on('close', (code) => { | |
console.log(`child process exited with code ${code}`); | |
}); |
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
const commandLineArgs = require('command-line-args') | |
const optionDefinitions = [ | |
{ name: 'fashion-last', type: String, multiple: true}, | |
{ name: 'ecomm-last', type: String, multiple: true} | |
]; | |
const options = commandLineArgs(optionDefinitions) | |
console.log(options); |
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
#!/bin/bash | |
echo ===== | |
echo node test.js ${*} | |
node test.js ${*} | |
echo ===== | |
echo ===== | |
echo node test.js "${@}" | |
node test.js "${@}" | |
echo ===== | |
echo ===== | |
echo node test.js "$@" | |
node test.js "$@" | |
echo ===== | |
echo "--this one kinda works--" | |
echo ===== | |
echo node test.js "$@" | |
node test.js $@ | |
echo ===== | |
Author
gdoteof
commented
Sep 30, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment