Skip to content

TristanBandat/cdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues Pull Requests MIT License closed Pull Requests closed Issues

CDIR

Script for creating new folders with consecutive numbering
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

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.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. Clone the repo

    git clone https://github.com/TristanBandat/cdir.git
  2. 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.

  3. 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/.
  4. Paste function call into your rc file

    Python:

    function cdir() {                                                                                      
       python3 ~/.bin/cdir.py "$*"                                                                   
    }

    C:

    function cdir() {                                                                                      
       ~/.bin/cdir_dev.out "$*"                                                                   
    }
  5. Update your rc file, restart your terminal or restart your system

Usage

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

Flags

  • Help
    Visit the help page with one of the following flags:
    Python:

    • -h
    • -?
    • --help
    • help
    C:
    • -h
    • --help
  • Version
    Get the current version of CDIR:

    • -v
    • -V
    • --version

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create.
Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Note: Look into the TODO file for open features and in which release they will be included.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Tristan Bandat - @TBandat - tristan.bandat@gmail.com

Project Link: https://github.com/TristanBandat/cdir