vscode-template icon indicating copy to clipboard operation
vscode-template copied to clipboard

Does Not Rename files inside sub-directories

Open orizens opened this issue 4 years ago • 5 comments

hi. Thanks for this extension.

i'm using Template v1.1.5 code to rename files, but files are not renamed:

replaceFileNameFn: (fileName, templateName, utils) => {
    const { path } = utils;
    // @see https://nodejs.org/api/path.html#path_path_parse_path
    const { base } = path.parse(fileName);
    // You can change the file name
    return base.replace(/__templateName__/gm, templateName);
  },

i have tried it with the template-sample - i created this file __templateName__.jsx. after create template with rename - the file is not renamed.

any suggestions?

orizens avatar Feb 05 '21 16:02 orizens

noticed vscode required an updated and issue resolved.

orizens avatar Feb 05 '21 16:02 orizens

just noticed file rename doesn't work with sub-directories. however, files content is renamed.

orizens avatar Feb 05 '21 16:02 orizens

Hi @orizens, Thanks for reporting Unfortunately, This extension is not supported rename sub-directory now. But I will consider the feature that rename the subdirectory. It looks to be a pretty good feature. Thank you 😁

stegano avatar Feb 06 '21 13:02 stegano

Hi @orizens I just fixed it and released v1.2.1 You can rename sub directories feature now,

If you want to use this feature, you have to update the extension and add settings. Please refer to the link(or remove template.config.js and trigger Create template, a new version template.config.js will be created)

  • https://github.com/stegano/vscode-template/blob/master/assets/template.config.js#L29L33

Thanks 😀

stegano avatar Feb 06 '21 17:02 stegano

Thanks so much @stegano I'll check it out during this week!

orizens avatar Feb 07 '21 00:02 orizens