Inserting copyright notice/banner in all source code files in Visual Studio 2012

后端 未结 6 1964
谎友^
谎友^ 2020-12-23 11:23

After some Googling I found this: Use a Visual Studio Macro to Insert Copyright Headers into Source Files. It looked promising:

// 

        
6条回答
  •  余生分开走
    2020-12-23 11:35

    After losing work to some obscure PowerShell script (not the one added as an answer), I decided to create copyright.py. Example usage:

    C:\>python copyright.py "C:\users\me\documents\path\to\vsproject"
    

    It recursively finds all *.cs files in the specified directory and prefixes them with the copyright text. It does not matter if other text already exists at the start of the file; it will be removed.

    Note: As a precaution, you should always backup your code before executing this script

提交回复
热议问题