Skip to content

Commit

Permalink
Merge pull request #78 from jsturgis/master
Browse files Browse the repository at this point in the history
[docs] Update the readme blueprint for local usage
  • Loading branch information
rwjblue authored Mar 29, 2020
2 parents b6271b7 + 508e591 commit 455a16b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions commands/global/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports.handler = async function handler(options) {
const { stripIndent } = require('common-tags');
const latestVersion = require('latest-version');
const pkg = require('../../package.json');
const cliPath = '/bin/cli.js';

fs.outputFileSync(
projectName + '/README.md',
Expand All @@ -37,6 +38,11 @@ module.exports.handler = async function handler(options) {
${projectName} <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
\`\`\`
## Local Usage
\`\`\`
node .${cliPath} <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
\`\`\`
## Transforms
<!--TRANSFORMS_START-->
Expand Down Expand Up @@ -72,7 +78,7 @@ module.exports.handler = async function handler(options) {
'update-docs': 'codemod-cli update-docs',
coveralls: 'cat ./coverage/lcov.info | node node_modules/.bin/coveralls',
},
bin: './bin/cli.js',
bin: `.${cliPath}`,
keywords: ['codemod-cli'],
dependencies: {
'codemod-cli': `^${pkg.version}`,
Expand Down Expand Up @@ -239,7 +245,7 @@ module.exports.handler = async function handler(options) {
`
);
fs.outputFileSync(
projectName + '/bin/cli.js',
`${projectName}${cliPath}`,
stripIndent`
#!/usr/bin/env node
'use strict';
Expand Down
5 changes: 5 additions & 0 deletions commands/local/generate/codemod.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ module.exports.handler = function handler(options) {
${projectName} ${codemodName} path/of/files/ or/some**/*glob.js
\`\`\`
## Local Usage
\`\`\`
node ./bin/cli.js ${codemodName} path/of/files/ or/some**/*glob.js
\`\`\`
## Input / Output
<!--FIXTURES_TOC_START-->
Expand Down

0 comments on commit 455a16b

Please sign in to comment.