Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coerschkes/co-scripts
A Collection of all my scripts I use during development and for quality of life
https://github.com/coerschkes/co-scripts
framework shell shell-scripts
Last synced: 16 days ago
JSON representation
A Collection of all my scripts I use during development and for quality of life
- Host: GitHub
- URL: https://github.com/coerschkes/co-scripts
- Owner: coerschkes
- Created: 2024-03-11T07:27:03.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-07-04T10:04:44.000Z (6 months ago)
- Last Synced: 2024-10-17T12:23:18.273Z (2 months ago)
- Topics: framework, shell, shell-scripts
- Language: Shell
- Homepage: https://github.com/coerschkes/co-scripts
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
co-scripts
A Collection of all my scripts I use during development and for quality of lifeTable of Contents
## About The Project
This is a collection of shellscripts for linux environments. I use them to update dependencies, print out stuff, managing my aliases, etc.. With this collection ships a simple framework for developing new scripts and registering aliases for the scripts.
## Getting Started
1. Checkout the project
```sh
git clone https://github.com/coerschkes/co-scripts.git
```
2. Set the env-variable "SCRIPT_DIR" to the root of this project
```sh
export SCRIPT_DIR=
```
> **_note_**
> For permanent access and functionality of the scripts, put the export statement into .bashrc or .profile
3. Run import-all.sh to register aliases for all important scripts
```sh
./import-all.sh
```
4. Restart your shell and there you go!> **_note_**
> If you have a .bash_aliases file and use it to manage your aliases don't run the import script cause it will overwrite the existing file. To use your aliases along with this framework move the alias definitions to .bashrc or .profile before running the import script.## Usage
The project differences between two types of scripts, visible and invisible. Invisible scripts start with an underscore ('\_') and are not recognized by the import or the print script. These scripts are used as helpers or library scripts. Visible scripts get imported and printed and are created by calling generate-script-template.sh or the alias:
```sh
new-script
```This creates a new script with a print() and an alias() function. To use this framework with autogenerated aliases and printing, these two functions are **_mandatory_** in every **_visible_** script - otherwise you get weird error messages cause these functions will get called.
To get an overview of all visible scripts available and all aliases they ship with simply execute the print-all.sh script or the alias:
```sh
ps
```Whenever you add a new visible script to the directory structure, simply execute import-all.sh or the alias:
```sh
is
```This will import the new script, register it with the alias returned from the **_alias_** function and print the usage by executing **_print_**. Before you can use your new script as alias you have to restart your shell.
> **_note_**
> If you add another folder to the structure or want to add specific scripts to printing/importing you have to edit the import-all/print-all script and add the designated path. This may work different in the future (I'm planning on tweaking this a little) but for now you gotta go with that.## Roadmap
- [ ] recursive script detection
- [X] description() for every script
- [X] print description() instead of usage when printing all
- [ ] calculate max-len for all script-aliases and print afterwards with fixed max-len
- [ ] improve template and template generation
- [X] standard script algorithm with switch
- [ ] script-scheme validator
- ...