Skip to content

Commit

Permalink
Edit contents on .md files (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz authored Feb 4, 2018
1 parent 2ee1158 commit 638f952
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export const component = (files: InquirerFile[]): {} => ({
type: 'autocomplete',
name: 'component',
message: 'Which component do you want to replicate?',
source: (_, input) => Promise.resolve(
files.filter(file => !input || file.value.toLowerCase().indexOf(input.toLowerCase()) >= 0)
),
source: (_, input) =>
Promise.resolve(
files.filter(file => !input || file.value.toLowerCase().indexOf(input.toLowerCase()) >= 0)
),
})

export const name = (originalName: string): {} => ({
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const isSingleFile = (path: string): boolean => {
}

export const getFiles = (cwd: string, componentName?: string): string[] => {
const extensions = '{js,ts,jsx,tsx,css,less,scss,sass,sss,json}'
const extensions = '{js,ts,jsx,tsx,css,less,scss,sass,sss,json,md}'
const pattern = componentName ? `**/${componentName}{.,.*.}${extensions}` : `**/*.${extensions}`
return glob.sync(pattern, { cwd, absolute: true, nodir: true })
}
Expand Down

0 comments on commit 638f952

Please sign in to comment.