Skip to content

Commit

Permalink
refactor: remove unnecessary helpers (#2637)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Apr 16, 2021
1 parent de7c1ae commit 43e5767
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 55 deletions.
12 changes: 7 additions & 5 deletions packages/generators/src/addon-generator.ts
Expand Up @@ -2,7 +2,6 @@ import fs from 'fs';
import path from 'path';
import Generator from 'yeoman-generator';

import { generatorCopy, generatorCopyTpl } from './utils/copy-utils';
import { List } from './utils/scaffold-utils';

/**
Expand Down Expand Up @@ -101,11 +100,14 @@ const addonGenerator = (
// eslint-disable-next-line @typescript-eslint/no-var-requires
this.fs.extendJSON(this.destinationPath('package.json'), require(packageJsonTemplatePath)(this.props.name));

this.copy = generatorCopy(this, this.resolvedTemplatePath);
this.copyTpl = generatorCopyTpl(this, this.resolvedTemplatePath, templateFn(this));
copyFiles.forEach((filePath) =>
this.fs.copyTpl(path.join(this.resolvedTemplatePath, filePath), this.destinationPath(filePath.replace('.tpl', ''))),
);

copyFiles.forEach(this.copy);
copyTemplateFiles.forEach(this.copyTpl);
copyTemplateFiles.forEach((filePath) => {
const destFilePath = filePath.replace('_', '').replace('.tpl', '');
this.fs.copyTpl(path.join(this.resolvedTemplatePath, filePath), this.destinationPath(destFilePath), templateFn(this));
});
}

public install(): void {
Expand Down
50 changes: 0 additions & 50 deletions packages/generators/src/utils/copy-utils.ts

This file was deleted.

0 comments on commit 43e5767

Please sign in to comment.