Last active
April 9, 2018 00:41
-
-
Save andresdominguez/d8ca87749a6186ff3a053cff9dd75be4 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
const fs = require('fs'); | |
const mappings = require('./mappings'); | |
function doId(path, token) { | |
if (!mappings[token]) { | |
console.log(`Cannot find ${token} mappings file.`); | |
process.exit(1); | |
} | |
const contents = mappings[token] + '\n' + | |
fs.readFileSync(path, 'utf-8'); | |
fs.writeFileSync(path, contents); | |
} | |
const myArgs = process.argv.slice(2); | |
if (myArgs.length !== 2) { | |
console.log('usage: boo <path> <token>'); | |
process.exit(1); | |
} | |
const [path, token] = myArgs; | |
doId(path, token); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment