question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File & Folder re-naming via symbols...

See original GitHub issue

I would like to see a way to rename targeted files and/or folders via symbol configuration.

If we are able to target “variables” inside of files, the addition of targeting asset naming might offer a more rounded experience. Because the templating engine is as flexible as it is, i.e. it does not matter what you put into your template so long as it meets the required contract, I can envision getting great use running dotnet new inside an already existing project. In other words, bring the scope down from the project level to a level that is a component of said project.

Examples…

Consider the following file structure in your template…

  • foo-folder/foo-controller.ts
  • foo-folder/foo-service.ts

Hypothetically we would be able to “dotnet new” this template to scaffold a new component inside an existing project.

Target individual assets

This would be the most granular approach…

"symbols": {
  "foo-folder-rename": {
    "type": "folder",
    "datatype": "string",
    "replaces": "foo-folder",
    "defaultValue": "new-compnent",
    "description": "Renames component folder"
  },
  "foo-controller-rename": {
    "type": "file",
    "datatype": "string",
    "replaces": "foo-controller",
    "defaultValue": "new-controller",
    "description": "Renames foo-controller"
  },
  "foo-service-rename": {
    "type": "file",
    "datatype": "string",
    "replaces": "foo-service",
    "defaultValue": "new-service",
    "description": "Renames foo-service"
  }
}

Batch target

More of an aggregated approach…

"symbols": {
  "component-rename" : {
    "type": "folder-file",
    "datatype": "string",
    "replaces": "foo",
    "defaultValue": "new-compnent",
    "description": "Renames folder and files"
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
mlorbetskecommented, Apr 10, 2017

You should be able to do this now by adding fileRename to the parameter:

  "symbols": {
    "x": {
      "type": "parameter",
      "dataType": "string",
      "fileRename": "test"
    }
  }

Will rename file or directory path segments containing “test” to have the user’s specified value

0reactions
FlavioKrahlcommented, May 2, 2018

@sayedihashimi is it possible to use the “fileRename” attribute with your sidewaffle creator somehow? Could you explain how to update my template wizard interface?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symbols replaced folders, sub-folders and file names
Hi I have a directory of folders, sub-folders and files that have all been renamed with symbols and I can no longer access...
Read more >
How to create folder name or file name with special ...
You can, of course, create files with names containing these characters using a different operating system (as long as that operating system ...
Read more >
Rename files based on symbols in the name
So as you can see, the renaming involves getting a certain symbol in file name and sometimes getting a sum of some symbols...
Read more >
Special Characters and Naming Files and Folders
Valid Special Characters for File and Folder Names ... Special characters are symbols such as & (ampersand) or * (asterisk). Some require a...
Read more >
How to Use Emojis in File and Folder Names in Windows 10
In Windows, you can use a variety of symbols in File Names like asterisk or star, colon, vertical pipe, straight double quote, etc....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found