Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Latest commit

 

History

History
53 lines (32 loc) · 1.61 KB

README.md

File metadata and controls

53 lines (32 loc) · 1.61 KB

licensify

Bash script inserting license headers to source files

If you have started a project and now want to license it, chances are that you do not want to manually add the header of the license to each file of your project. This scripts intends to help you through this task, by recursively adding the headers to all source files of your project (or only to the ones you specified).

What this script does

Adding customizable headers using templates and options inside the script.

The currently implemented options are :

  • author, year, project name
  • type of source files to modify
  • type of comment to use (C-style by default : /* */)
  • license template (gpl3 header by default)

What this script does not

Update or remove headers

Usage

To use this script, place it in your project root directory. Then change the various options inside it to fit your needs.

Then, you have two choices :

  • I want to add headers to all the files with extension .ext inside my project :
./licensify
  • I want to add headers only to some of the files of my project :
./licensify [path_to_file1] [path_to_file2] ...

In this case, the modifiable variable ext of the script will be ignored.

You are strongly advised to use a version control system before executing this script inside your project.

Verbose mode

Both choices can print the list of affected files, by adding -v as the first command line argument:

./licensify -v [path_to_file]

NB: If a file counts less lines than the offset parameter inside the script, the header will not be inserted in that particular file.