[
  {
    "path": ".gitignore",
    "content": "# Compiled C output\n*.out\n\n# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Typescript v1 declaration files\ntypings/\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variables file\n.env\n\n"
  },
  {
    "path": ".npmignore",
    "content": "*.c\n*.out\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Max\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# undollar\nundollar strips the dollar sign from the beginning of the terminal command you just copied from StackOverflow when you were searching for what arguments to pass to `tar` (`xzf`? `xvfJ`? Or was it `xvf`? You never seem to remember).\n\n## Installation\nSimply install undollar as a global package using npm or yarn:\n```\n$ npm install -g undollar\n```\nwell, because you haven't installed it yet,\n```\nnpm install -g undollar\n```\n\n## Usage\nAfter you've installed undollar, you can forget it exists. Next time you paste in a command prefixed with a dollar sign, undollar will quietly eat the dollar sign and run the rest of the command.\n```\nneo@computey:~$ $ tar xvfJ something.tar.xz\nneo@computey:~$\nneo@computey:~$ echo \"It worked! Thanks undollar!\"\n\n```\nIt's as if that stray dollar sign was never there in the first place!\n\n## Wait what\nPeople often put a \"$\" in front of a command to indicate that it must be executed on the command line. This is because, on Unix-like operating systems, the command-prompt usually ends in a \"$\" for non-root users -- so the last thing before a command is a \"$\".\n\nOften when copy-pasting terminal commands from the internet you'll inadvertently end up also having copied the dollar sign at the beginning (especially if you triple-click to select). Trying to execute the command you just pasted will result in some variant of \"command not found\" or \"No such file or directory\".\n\nInstalling undollar solves this problem, by registering `$` as a valid command, which simply runs everything after that `$`.\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"undollar\",\n  \"version\": \"1.0.0\",\n  \"description\": \"undollar strips the dollar sign from the beginning of the terminal command you just copied from StackOverflow when you were searching for what arguments to pass to `tar` (`xzf`? `xvfJ`? Or was it `xvf`? You never seem to remember).\",\n  \"preferGlobal\": true,\n  \"bin\": {\n    \"$\": \"./undollar.js\"\n  },\n  \"main\": \"undollar.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/ImFeelingDucky/undollar.git\"\n  },\n  \"keywords\": [\n    \"command-line\",\n    \"convenience\",\n    \"copy-paste\",\n    \"dollar\"\n  ],\n  \"author\": \"Max Tyrrell\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/ImFeelingDucky/undollar/issues\"\n  },\n  \"homepage\": \"https://github.com/ImFeelingDucky/undollar#readme\",\n  \"dependencies\": {}\n}\n"
  },
  {
    "path": "undollar.js",
    "content": "#!/usr/bin/env node\n\nconst { spawn } = require('child_process')\n\nif (!process.argv[2]) {\n    console.log('Usage: $ command [args] where command is any valid terminal command.')\n    process.exit()\n}\n\n// Run a command with its arguments by spawning a process and\n// transparently routing stdio and signals through this parent process\nconst spawnedProcess = spawn(\n    process.argv[2],\n    process.argv.slice(3),\n    {stdio: 'inherit'}\n);\n\n// Route signals through so they still reach the spawned process\nprocess.on('SIGTERM', () => spawnedProcess.kill('SIGTERM'))\nprocess.on('SIGINT', () => spawnedProcess.kill('SIGINT'))\nprocess.on('SIGBREAK', () => spawnedProcess.kill('SIGBREAK'))\nprocess.on('SIGHUP', () => spawnedProcess.kill('SIGHUP'))\n\n// Exit this process when the spawned process exits\nspawnedProcess.on('exit', process.exit)\n"
  }
]