Skip to content

Commit

Permalink
refactor(editorconfig): used an ini extension for the template
Browse files Browse the repository at this point in the history
since the file uses the ini format: https://editorconfig.org/#file-format-details
  • Loading branch information
travi committed Feb 12, 2024
1 parent dbe0395 commit 1d5a217
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {lift, questionNames, scaffold} from './lib/index.js';

// remark-usage-ignore-next 2
(async () => {
stubbedFs({templates: {'editorconfig.txt': await fs.readFile(resolve('templates', 'editorconfig.txt'))}});
stubbedFs({templates: {'editorconfig.ini': await fs.readFile(resolve('templates', 'editorconfig.ini'))}});

await scaffold({
decisions: {
Expand Down
2 changes: 1 addition & 1 deletion src/editorconfig/scaffolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import {promises as fs} from 'node:fs';
import determinePathToTemplateFile from '../template-path.js';

export default function ({projectRoot}) {
return fs.copyFile(determinePathToTemplateFile('editorconfig.txt'), `${projectRoot}/.editorconfig`);
return fs.copyFile(determinePathToTemplateFile('editorconfig.ini'), `${projectRoot}/.editorconfig`);
}
2 changes: 1 addition & 1 deletion src/editorconfig/scaffolder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('editorconfig scaffolder', () => {
await scaffoldEditorconfig({projectRoot});

expect(fs.copyFile).toHaveBeenCalledWith(
resolve(__dirname, '..', '..', 'templates', 'editorconfig.txt'),
resolve(__dirname, '..', '..', 'templates', 'editorconfig.ini'),
`${projectRoot}/.editorconfig`
);
});
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/integration/features/step_definitions/common-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Before({timeout: 20 * 1000}, async function () {

stubbedFs({
node_modules: stubbedNodeModules,
templates: {'editorconfig.txt': await fs.readFile(resolve(...projectTemplatePath, 'editorconfig.txt'))}
templates: {'editorconfig.ini': await fs.readFile(resolve(...projectTemplatePath, 'editorconfig.ini'))}
});
});

Expand Down

0 comments on commit 1d5a217

Please sign in to comment.