Skip to content

Commit 6bf475a

Browse files
committed
Remove extra globby call in bin-support/runTemplateTransform
As ember-template-recast handles that, #81 (comment)
1 parent 9dba17c commit 6bf475a

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/bin-support.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const DEFAULT_JS_EXTENSIONS = 'js,ts';
4-
const DEFAULT_TEMPLATE_EXTENSIONS = 'hbs';
54

65
async function runJsTransform(binRoot, transformName, args, extensions = DEFAULT_JS_EXTENSIONS) {
76
const globby = require('globby');
@@ -38,13 +37,7 @@ async function runJsTransform(binRoot, transformName, args, extensions = DEFAULT
3837
}
3938
}
4039

41-
async function runTemplateTransform(
42-
binRoot,
43-
transformName,
44-
args,
45-
extensions = DEFAULT_TEMPLATE_EXTENSIONS
46-
) {
47-
const globby = require('globby');
40+
async function runTemplateTransform(binRoot, transformName, args) {
4841
const execa = require('execa');
4942
const chalk = require('chalk');
5043
const path = require('path');
@@ -53,11 +46,8 @@ async function runTemplateTransform(
5346
let { paths, options } = parseTransformArgs(args);
5447

5548
try {
56-
let foundPaths = await globby(paths, {
57-
expandDirectories: { extensions: extensions.split(',') },
58-
});
5949
let transformPath = path.join(binRoot, '..', 'transforms', transformName, 'index.js');
60-
let binOptions = ['-t', transformPath, ...foundPaths];
50+
let binOptions = ['-t', transformPath, ...paths];
6151

6252
return execa('ember-template-recast', binOptions, {
6353
stdio: 'inherit',
@@ -79,7 +69,7 @@ async function runTransform(binRoot, transformName, args, extensions, type = 'js
7969
case 'jscodeshift':
8070
return runJsTransform(binRoot, transformName, args, extensions);
8171
case 'template':
82-
return runTemplateTransform(binRoot, transformName, args, extensions);
72+
return runTemplateTransform(binRoot, transformName, args);
8373
default:
8474
throw new Error(`Unknown type passed to runTransform: "${type}"`);
8575
}

0 commit comments

Comments
 (0)