Script for creating new folders with consecutive numbering
Explore the docs »
Report Bug
·
Request Feature
The goal of this project is to create a function that makes folder creating much faster.
The function detects on its own if there is an existing folder structure
[FOLDERNAME]_[NUMBER]
and creates a folder with the directory name
[FOLDERNAME]_[NUMBER+1]
.
This works with the function call in the corresponding folder only -
no additional arguments required.
To get a local copy up and running follow these simple steps.
-
Clone the repo
git clone https://github.com/TristanBandat/cdir.git
-
Choose between the Python or the C version.
The Python version will get updates first but is a little slower and needs a Python 3 Interpreter (at least Python 3.6).
The C version is more stable but the releases take a little bit longer. -
Copy the chosen file in a separate folder
Note: If you do not have a folder called.bin
in your home directory you should create one first (recommended) or copy the files directly into your home directory (not recommended).
Python:cp cdir.py ~/.bin/.
C:
Note: If may have to compile the included C file for your system!cp C_development/cdir_dev.out ~/.bin/.
-
Paste function call into your rc file
Python:function cdir() { python3 ~/.bin/cdir.py "$*" }
C:
function cdir() { ~/.bin/cdir_dev.out "$*" }
-
Update your rc file, restart your terminal or restart your system
If there exists at least one directory with the correct naming convention, one can simply call the program without additional arguments. CDIR will automatically choose the correct directory name.
~/Folder/% cdir
Note: CDIR will always choose the directory with the highest occurrence if you do not parse an additional argument with the preferred name.
If the function gets a directory name as argument, the function detects any existing folders with that name (if they exist) and creates a new directory with the given name and the next available number:
~/Folder/% cdir New_Folder
Note: If the directory with given name does not exist, the numbering will start at 0.
If the function gets a directory name and a number as argument, the function will, additionally to the folder detection,
create as many directories in consecutive numbering as specified.
For example if you want to create 10 folders with the name 'Exercise' just type:
~/Folder/% cdir Exercise 10
-
Help
Visit the help page with one of the following flags:
Python:- -h
- -?
- --help
- help
- -h
- --help
-
Version
Get the current version of CDIR:- -v
- -V
- --version
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create.
Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Note: Look into the TODO file for open features and in which release they will be included.
Distributed under the MIT License. See LICENSE
for more information.
Tristan Bandat - @TBandat - tristan.bandat@gmail.com
Project Link: https://github.com/TristanBandat/cdir